luaconf.h.in 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. ** Configuration header.
  3. ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h
  4. */
  5. #ifndef luaconf_h
  6. #define luaconf_h
  7. #include <limits.h>
  8. #include <stddef.h>
  9. #cmakedefine LUAJIT_DISABLE_FFI
  10. #cmakedefine LUAJIT_ENABLE_LUA52COMPAT
  11. #cmakedefine LUAJIT_DISABLE_JIT
  12. #cmakedefine LUAJIT_USE_SYSMALLOC
  13. #cmakedefine LUAJIT_USE_VALGRIND
  14. #cmakedefine LUAJIT_USE_GDBJIT
  15. #cmakedefine LUA_USE_APICHECK
  16. #cmakedefine LUA_USE_ASSERT
  17. #cmakedefine LUAJIT_CPU_SSE2
  18. #cmakedefine LUAJIT_CPU_NOCMOV
  19. /* Default path for loading Lua and C modules with require(). */
  20. #cmakedefine LUA_MODULE_SUFFIX "@LUA_MODULE_SUFFIX@"
  21. #cmakedefine LUA_DIR "@LUA_DIR@"
  22. #cmakedefine LUA_LDIR "@LUA_LDIR@"
  23. #cmakedefine LUA_CDIR "@LUA_CDIR@"
  24. #define LUA_PATH_DEFAULT "@LUA_PATH_DEFAULT@"
  25. #define LUA_CPATH_DEFAULT "@LUA_CPATH_DEFAULT@"
  26. /* Environment variable names for path overrides and initialization code. */
  27. #cmakedefine LUA_PATH "@LUA_PATH@"
  28. #cmakedefine LUA_CPATH "@LUA_CPATH@"
  29. #cmakedefine LUA_INIT "@LUA_INIT@"
  30. /* Special file system characters. */
  31. #cmakedefine LUA_DIRSEP "@LUA_DIRSEP@"
  32. #define LUA_PATHSEP ";"
  33. #define LUA_PATH_MARK "?"
  34. #define LUA_EXECDIR "!"
  35. #define LUA_IGMARK "-"
  36. #define LUA_PATH_CONFIG \
  37. LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \
  38. LUA_EXECDIR "\n" LUA_IGMARK
  39. /* Quoting in error messages. */
  40. #define LUA_QL(x) "'" x "'"
  41. #define LUA_QS LUA_QL("%s")
  42. /* Various tunables. */
  43. #cmakedefine LUAI_MAXSTACK @LUAI_MAXSTACK@ /* Max. # of stack slots for a thread (<64K). */
  44. #cmakedefine LUAI_MAXCSTACK @LUAI_MAXCSTACK@ /* Max. # of stack slots for a C func (<10K). */
  45. #cmakedefine LUAI_GCPAUSE @LUAI_GCPAUSE@ /* Pause GC until memory is at 200%. */
  46. #cmakedefine LUAI_GCMUL @LUAI_GCMUL@ /* Run GC at 200% of allocation speed. */
  47. #cmakedefine LUA_MAXCAPTURES @LUA_MAXCAPTURES@ /* Max. pattern captures. */
  48. /* Compatibility with older library function names. */
  49. #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */
  50. #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */
  51. /* Configuration for the frontend (the luajit executable). */
  52. #if defined(luajit_c)
  53. #define LUA_PROGNAME "luajit" /* Fallback frontend name. */
  54. #cmakedefine LUA_PROMPT "@LUA_PROMPT@" /* Interactive prompt. */
  55. #cmakedefine LUA_PROMPT2 "@LUA_PROMPT2@" /* Continuation prompt. */
  56. #cmakedefine LUA_MAXINPUT @LUA_MAXINPUT@ /* Max. input line length. */
  57. #endif
  58. /* Note: changing the following defines breaks the Lua 5.1 ABI. */
  59. #define LUA_INTEGER ptrdiff_t
  60. #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */
  61. /*
  62. ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using
  63. ** unreasonable amounts of stack space, but still retain ABI compatibility.
  64. ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it.
  65. */
  66. #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ)
  67. /* The following defines are here only for compatibility with luaconf.h
  68. ** from the standard Lua distribution. They must not be changed for LuaJIT.
  69. */
  70. #define LUA_NUMBER_DOUBLE
  71. #define LUA_NUMBER double
  72. #define LUAI_UACNUMBER double
  73. #define LUA_NUMBER_SCAN "%lf"
  74. #define LUA_NUMBER_FMT "%.14g"
  75. #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n))
  76. #define LUAI_MAXNUMBER2STR 32
  77. #define LUA_INTFRMLEN "l"
  78. #define LUA_INTFRM_T long
  79. /* Linkage of public API functions. */
  80. #if defined(LUA_BUILD_AS_DLL)
  81. #if defined(LUA_CORE) || defined(LUA_LIB)
  82. #define LUA_API __declspec(dllexport)
  83. #else
  84. #define LUA_API __declspec(dllimport)
  85. #endif
  86. #else
  87. #define LUA_API extern
  88. #endif
  89. #define LUALIB_API LUA_API
  90. /* Support for internal assertions. */
  91. #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)
  92. #include <assert.h>
  93. #endif
  94. #ifdef LUA_USE_ASSERT
  95. #define lua_assert(x) assert(x)
  96. #endif
  97. #ifdef LUA_USE_APICHECK
  98. #define luai_apicheck(L, o) { (void)L; assert(o); }
  99. #else
  100. #define luai_apicheck(L, o) { (void)L; }
  101. #endif
  102. #endif