luaconf.h 3.6 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. /* #undef LUAJIT_DISABLE_FFI */
  10. #define LUAJIT_ENABLE_LUA52COMPAT
  11. /* #undef LUAJIT_DISABLE_JIT */
  12. /* #undef LUAJIT_USE_SYSMALLOC */
  13. /* #undef LUAJIT_USE_VALGRIND */
  14. /* #undef LUAJIT_USE_GDBJIT */
  15. /* #undef LUA_USE_APICHECK */
  16. /* #undef LUA_USE_ASSERT */
  17. /* #undef LUAJIT_CPU_SSE2 */
  18. /* #undef LUAJIT_CPU_NOCMOV */
  19. /* Default path for loading Lua and C modules with require(). */
  20. #define LUA_MODULE_SUFFIX ".so"
  21. #define LUA_DIR "!/../"
  22. #define LUA_LDIR "lib/lua"
  23. #define LUA_CDIR "lib/lua"
  24. #define LUA_PATH_DEFAULT "./?.lua;!/../lib/lua/?.lua;!/../lib/lua/?/init.lua;./?/init.lua"
  25. #define LUA_CPATH_DEFAULT "./?.so;!/../lib/lua/?.so;!/../lib/lua/loadall.so"
  26. /* Environment variable names for path overrides and initialization code. */
  27. #define LUA_PATH "LUA_PATH"
  28. #define LUA_CPATH "LUA_CPATH"
  29. #define LUA_INIT "LUA_INIT"
  30. /* Special file system characters. */
  31. #define 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. #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */
  44. #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */
  45. #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */
  46. #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */
  47. #define LUA_MAXCAPTURES 32 /* 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. #define LUA_PROMPT "> " /* Interactive prompt. */
  55. #define LUA_PROMPT2 ">> " /* Continuation prompt. */
  56. #define LUA_MAXINPUT 512 /* 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