lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Apr 26, 2014 5:38 AM, David Demelier wrote:

> I'm very happy to announce the first release candidate of Lua-SDL2
> Lua-SDL2 is a pure C binding against SDL 2.0.3.
> ...
> It should compile on major platforms which support C and SDL.


Cool!

I checked out the HG repo but got an error compiling on ArchLinux...

./src/haptic.c:79:3: error:
  'for' loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < 3; ++i) {
   ^

GCC says:
  Note: use option -std=c99 or -std=gnu99 to compile your code.


But I think the more portable fix would be to declare 'i' first:

if (lua_type(L, -1) == LUA_TTABLE) {
  int i;
  for (i = 0; i < 3; ++i) {
   ...
  }
}

After that change 'make' succeeds.

Nice work, David!

 - Jeff