Browse Source

lua: compilation fixes for non-quite-POSIX platforms.

legacy
Sam Hocevar sam 12 years ago
parent
commit
62870d0894
35 changed files with 118 additions and 1 deletions
  1. +1
    -1
      configure.ac
  2. +3
    -0
      src/lua/lapi.c
  3. +3
    -0
      src/lua/lauxlib.c
  4. +3
    -0
      src/lua/lbaselib.c
  5. +4
    -0
      src/lua/lbitlib.c
  6. +3
    -0
      src/lua/lcode.c
  7. +3
    -0
      src/lua/lcorolib.c
  8. +4
    -0
      src/lua/lctype.c
  9. +3
    -0
      src/lua/ldblib.c
  10. +3
    -0
      src/lua/ldebug.c
  11. +3
    -0
      src/lua/ldo.c
  12. +4
    -0
      src/lua/ldump.c
  13. +3
    -0
      src/lua/lfunc.c
  14. +4
    -0
      src/lua/lgc.c
  15. +3
    -0
      src/lua/linit.c
  16. +3
    -0
      src/lua/liolib.c
  17. +3
    -0
      src/lua/llex.c
  18. +3
    -0
      src/lua/lmathlib.c
  19. +3
    -0
      src/lua/lmem.c
  20. +7
    -0
      src/lua/loadlib.c
  21. +4
    -0
      src/lua/lobject.c
  22. +3
    -0
      src/lua/lopcodes.c
  23. +7
    -0
      src/lua/loslib.c
  24. +3
    -0
      src/lua/lparser.c
  25. +3
    -0
      src/lua/lstate.c
  26. +3
    -0
      src/lua/lstring.c
  27. +3
    -0
      src/lua/lstrlib.c
  28. +3
    -0
      src/lua/ltable.c
  29. +3
    -0
      src/lua/ltablib.c
  30. +3
    -0
      src/lua/ltm.c
  31. +3
    -0
      src/lua/lua.c
  32. +4
    -0
      src/lua/luac.c
  33. +4
    -0
      src/lua/lundump.c
  34. +3
    -0
      src/lua/lvm.c
  35. +3
    -0
      src/lua/lzio.c

+ 1
- 1
configure.ac View File

@@ -88,7 +88,7 @@ AC_CHECK_HEADERS(cxxabi.h)
AC_LANG_POP(C++) AC_LANG_POP(C++)


dnl Common C functions dnl Common C functions
AC_CHECK_FUNCS(getcwd _getcwd backtrace_symbols)
AC_CHECK_FUNCS(getenv getcwd _getcwd backtrace_symbols)




if test "${enable_debug}" = "yes"; then if test "${enable_debug}" = "yes"; then


+ 3
- 0
src/lua/lapi.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>


+ 3
- 0
src/lua/lauxlib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>


+ 3
- 0
src/lua/lbaselib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END




#include <ctype.h> #include <ctype.h>


+ 4
- 0
src/lua/lbitlib.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#define lbitlib_c #define lbitlib_c
#define LUA_LIB #define LUA_LIB




+ 3
- 0
src/lua/lcode.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdlib.h> #include <stdlib.h>




+ 3
- 0
src/lua/lcorolib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdlib.h> #include <stdlib.h>




+ 4
- 0
src/lua/lctype.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#define lctype_c #define lctype_c
#define LUA_CORE #define LUA_CORE




+ 3
- 0
src/lua/ldblib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>


+ 3
- 0
src/lua/ldebug.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>


+ 3
- 0
src/lua/ldo.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <setjmp.h> #include <setjmp.h>
#include <stdlib.h> #include <stdlib.h>


+ 4
- 0
src/lua/ldump.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#include <stddef.h> #include <stddef.h>


#define ldump_c #define ldump_c


+ 3
- 0
src/lua/lfunc.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stddef.h> #include <stddef.h>




+ 4
- 0
src/lua/lgc.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#include <string.h> #include <string.h>


#define lgc_c #define lgc_c


+ 3
- 0
src/lua/linit.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


/* /*
** If you embed Lua in your program and need to open the standard ** If you embed Lua in your program and need to open the standard


+ 3
- 0
src/lua/liolib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


/* /*
** POSIX idiosyncrasy! ** POSIX idiosyncrasy!


+ 3
- 0
src/lua/llex.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <locale.h> #include <locale.h>
#include <string.h> #include <string.h>


+ 3
- 0
src/lua/lmathlib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>


+ 3
- 0
src/lua/lmem.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stddef.h> #include <stddef.h>




+ 7
- 0
src/lua/loadlib.c View File

@@ -8,6 +8,9 @@
** systems. ** systems.
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


/* /*
** if needed, includes windows header before everything else ** if needed, includes windows header before everything else
@@ -636,9 +639,13 @@ static int noenv (lua_State *L) {


static void setpath (lua_State *L, const char *fieldname, const char *envname1, static void setpath (lua_State *L, const char *fieldname, const char *envname1,
const char *envname2, const char *def) { const char *envname2, const char *def) {
#if HAVE_GETENV // LOL BEGIN
const char *path = getenv(envname1); const char *path = getenv(envname1);
if (path == NULL) /* no environment variable? */ if (path == NULL) /* no environment variable? */
path = getenv(envname2); /* try alternative name */ path = getenv(envname2); /* try alternative name */
#else
const char *path = NULL;
#endif // LOL END
if (path == NULL || noenv(L)) /* no environment variable? */ if (path == NULL || noenv(L)) /* no environment variable? */
lua_pushstring(L, def); /* use default */ lua_pushstring(L, def); /* use default */
else { else {


+ 4
- 0
src/lua/lobject.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>


+ 3
- 0
src/lua/lopcodes.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#define lopcodes_c #define lopcodes_c
#define LUA_CORE #define LUA_CORE


+ 7
- 0
src/lua/loslib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <errno.h> #include <errno.h>
#include <locale.h> #include <locale.h>
@@ -114,7 +117,11 @@ static int os_tmpname (lua_State *L) {




static int os_getenv (lua_State *L) { static int os_getenv (lua_State *L) {
#if HAVE_GETENV // LOL BEGIN
lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */
#else
lua_pushstring(L, NULL);
#endif // LOL END
return 1; return 1;
} }




+ 3
- 0
src/lua/lparser.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <string.h> #include <string.h>




+ 3
- 0
src/lua/lstate.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>


+ 3
- 0
src/lua/lstring.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <string.h> #include <string.h>




+ 3
- 0
src/lua/lstrlib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <ctype.h> #include <ctype.h>
#include <stddef.h> #include <stddef.h>


+ 3
- 0
src/lua/ltable.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


/* /*
** Implementation of tables (aka arrays, objects, or hash tables). ** Implementation of tables (aka arrays, objects, or hash tables).


+ 3
- 0
src/lua/ltablib.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stddef.h> #include <stddef.h>




+ 3
- 0
src/lua/ltm.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <string.h> #include <string.h>




+ 3
- 0
src/lua/lua.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#if 0 // LOL BEGIN #if 0 // LOL BEGIN
#include <signal.h> #include <signal.h>


+ 4
- 0
src/lua/luac.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>


+ 4
- 0
src/lua/lundump.c View File

@@ -4,6 +4,10 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END

#include <string.h> #include <string.h>


#define lundump_c #define lundump_c


+ 3
- 0
src/lua/lvm.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>


+ 3
- 0
src/lua/lzio.c View File

@@ -4,6 +4,9 @@
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */


#if defined HAVE_CONFIG_H // LOL BEGIN
# include "config.h"
#endif // LOL END


#include <string.h> #include <string.h>




Loading…
Cancel
Save