1564b9ff2SBrooks Davis /* 20495ed39SKyle Evans ** $Id: luaconf.h $ 3564b9ff2SBrooks Davis ** Configuration file for Lua 4564b9ff2SBrooks Davis ** See Copyright Notice in lua.h 5564b9ff2SBrooks Davis */ 6564b9ff2SBrooks Davis 7564b9ff2SBrooks Davis 8564b9ff2SBrooks Davis #ifndef luaconf_h 9564b9ff2SBrooks Davis #define luaconf_h 10564b9ff2SBrooks Davis 11564b9ff2SBrooks Davis #include <limits.h> 12564b9ff2SBrooks Davis #include <stddef.h> 13564b9ff2SBrooks Davis 14564b9ff2SBrooks Davis 15564b9ff2SBrooks Davis /* 16564b9ff2SBrooks Davis ** =================================================================== 170495ed39SKyle Evans ** General Configuration File for Lua 180495ed39SKyle Evans ** 190495ed39SKyle Evans ** Some definitions here can be changed externally, through the 200495ed39SKyle Evans ** compiler (e.g., with '-D' options). Those are protected by 210495ed39SKyle Evans ** '#if !defined' guards. However, several other definitions should 220495ed39SKyle Evans ** be changed directly here, either because they affect the Lua 230495ed39SKyle Evans ** ABI (by making the changes here, you ensure that all software 240495ed39SKyle Evans ** connected to Lua, such as C libraries, will be compiled with the 250495ed39SKyle Evans ** same configuration); or because they are seldom changed. 260495ed39SKyle Evans ** 27564b9ff2SBrooks Davis ** Search for "@@" to find all configurable definitions. 28564b9ff2SBrooks Davis ** =================================================================== 29564b9ff2SBrooks Davis */ 30564b9ff2SBrooks Davis 31564b9ff2SBrooks Davis 32564b9ff2SBrooks Davis /* 33564b9ff2SBrooks Davis ** {==================================================================== 34564b9ff2SBrooks Davis ** System Configuration: macros to adapt (if needed) Lua to some 350495ed39SKyle Evans ** particular platform, for instance restricting it to C89. 36564b9ff2SBrooks Davis ** ===================================================================== 37564b9ff2SBrooks Davis */ 38564b9ff2SBrooks Davis 39564b9ff2SBrooks Davis /* 40564b9ff2SBrooks Davis @@ LUA_USE_C89 controls the use of non-ISO-C89 features. 41564b9ff2SBrooks Davis ** Define it if you want Lua to avoid the use of a few C99 features 42564b9ff2SBrooks Davis ** or Windows-specific features on Windows. 43564b9ff2SBrooks Davis */ 44564b9ff2SBrooks Davis /* #define LUA_USE_C89 */ 45564b9ff2SBrooks Davis 46564b9ff2SBrooks Davis 47564b9ff2SBrooks Davis /* 48564b9ff2SBrooks Davis ** By default, Lua on Windows use (some) specific Windows features 49564b9ff2SBrooks Davis */ 50564b9ff2SBrooks Davis #if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) 51564b9ff2SBrooks Davis #define LUA_USE_WINDOWS /* enable goodies for regular Windows */ 52564b9ff2SBrooks Davis #endif 53564b9ff2SBrooks Davis 54564b9ff2SBrooks Davis 55564b9ff2SBrooks Davis #if defined(LUA_USE_WINDOWS) 56564b9ff2SBrooks Davis #define LUA_DL_DLL /* enable support for DLL */ 57564b9ff2SBrooks Davis #define LUA_USE_C89 /* broadly, Windows is C89 */ 58564b9ff2SBrooks Davis #endif 59564b9ff2SBrooks Davis 60564b9ff2SBrooks Davis 61564b9ff2SBrooks Davis #if defined(LUA_USE_LINUX) 62564b9ff2SBrooks Davis #define LUA_USE_POSIX 63564b9ff2SBrooks Davis #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ 64564b9ff2SBrooks Davis #endif 65564b9ff2SBrooks Davis 66564b9ff2SBrooks Davis 67564b9ff2SBrooks Davis #if defined(LUA_USE_MACOSX) 68564b9ff2SBrooks Davis #define LUA_USE_POSIX 69564b9ff2SBrooks Davis #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ 70564b9ff2SBrooks Davis #endif 71564b9ff2SBrooks Davis 72564b9ff2SBrooks Davis /* Local modifications: need io.popen */ 73564b9ff2SBrooks Davis #ifdef __FreeBSD__ 74564b9ff2SBrooks Davis #define LUA_USE_POSIX 75c2a2b4f3SKyle Evans #ifndef BOOTSTRAPPING 763bd84195SEd Maste #define LUA_USE_DLOPEN 77564b9ff2SBrooks Davis #endif 78c2a2b4f3SKyle Evans #endif 79564b9ff2SBrooks Davis 80564b9ff2SBrooks Davis /* 810495ed39SKyle Evans @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. 820495ed39SKyle Evans */ 830495ed39SKyle Evans #define LUAI_IS32INT ((UINT_MAX >> 30) >= 3) 840495ed39SKyle Evans 850495ed39SKyle Evans /* }================================================================== */ 860495ed39SKyle Evans 870495ed39SKyle Evans 880495ed39SKyle Evans 890495ed39SKyle Evans /* 900495ed39SKyle Evans ** {================================================================== 910495ed39SKyle Evans ** Configuration for Number types. 920495ed39SKyle Evans ** =================================================================== 930495ed39SKyle Evans */ 940495ed39SKyle Evans 950495ed39SKyle Evans /* 960495ed39SKyle Evans @@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. 970495ed39SKyle Evans */ 980495ed39SKyle Evans /* #define LUA_32BITS */ 990495ed39SKyle Evans 1000495ed39SKyle Evans 1010495ed39SKyle Evans /* 102564b9ff2SBrooks Davis @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for 103564b9ff2SBrooks Davis ** C89 ('long' and 'double'); Windows always has '__int64', so it does 104564b9ff2SBrooks Davis ** not need to use this case. 105564b9ff2SBrooks Davis */ 106564b9ff2SBrooks Davis #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) 107564b9ff2SBrooks Davis #define LUA_C89_NUMBERS 108564b9ff2SBrooks Davis #endif 109564b9ff2SBrooks Davis 110564b9ff2SBrooks Davis 111564b9ff2SBrooks Davis /* 112564b9ff2SBrooks Davis @@ LUA_INT_TYPE defines the type for Lua integers. 113564b9ff2SBrooks Davis @@ LUA_FLOAT_TYPE defines the type for Lua floats. 1140495ed39SKyle Evans ** Lua should work fine with any mix of these options supported 1150495ed39SKyle Evans ** by your C compiler. The usual configurations are 64-bit integers 116564b9ff2SBrooks Davis ** and 'double' (the default), 32-bit integers and 'float' (for 117564b9ff2SBrooks Davis ** restricted platforms), and 'long'/'double' (for C compilers not 118564b9ff2SBrooks Davis ** compliant with C99, which may not have support for 'long long'). 119564b9ff2SBrooks Davis */ 120564b9ff2SBrooks Davis 121564b9ff2SBrooks Davis /* predefined options for LUA_INT_TYPE */ 122564b9ff2SBrooks Davis #define LUA_INT_INT 1 123564b9ff2SBrooks Davis #define LUA_INT_LONG 2 124564b9ff2SBrooks Davis #define LUA_INT_LONGLONG 3 125564b9ff2SBrooks Davis 126564b9ff2SBrooks Davis /* predefined options for LUA_FLOAT_TYPE */ 127564b9ff2SBrooks Davis #define LUA_FLOAT_FLOAT 1 128564b9ff2SBrooks Davis #define LUA_FLOAT_DOUBLE 2 129564b9ff2SBrooks Davis #define LUA_FLOAT_LONGDOUBLE 3 1300c54932dSAlex Richardson #define LUA_FLOAT_INT64 4 131564b9ff2SBrooks Davis 132564b9ff2SBrooks Davis #if defined(LUA_32BITS) /* { */ 133564b9ff2SBrooks Davis /* 134564b9ff2SBrooks Davis ** 32-bit integers and 'float' 135564b9ff2SBrooks Davis */ 1360495ed39SKyle Evans #if LUAI_IS32INT /* use 'int' if big enough */ 137564b9ff2SBrooks Davis #define LUA_INT_TYPE LUA_INT_INT 138564b9ff2SBrooks Davis #else /* otherwise use 'long' */ 139564b9ff2SBrooks Davis #define LUA_INT_TYPE LUA_INT_LONG 140564b9ff2SBrooks Davis #endif 141564b9ff2SBrooks Davis #define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT 142564b9ff2SBrooks Davis 143564b9ff2SBrooks Davis #elif defined(LUA_C89_NUMBERS) /* }{ */ 144564b9ff2SBrooks Davis /* 145564b9ff2SBrooks Davis ** largest types available for C89 ('long' and 'double') 146564b9ff2SBrooks Davis */ 147564b9ff2SBrooks Davis #define LUA_INT_TYPE LUA_INT_LONG 148564b9ff2SBrooks Davis #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE 149564b9ff2SBrooks Davis 150564b9ff2SBrooks Davis #endif /* } */ 151564b9ff2SBrooks Davis 152564b9ff2SBrooks Davis 153564b9ff2SBrooks Davis /* 154564b9ff2SBrooks Davis ** default configuration for 64-bit Lua ('long long' and 'double') 155564b9ff2SBrooks Davis */ 156564b9ff2SBrooks Davis #if !defined(LUA_INT_TYPE) 157564b9ff2SBrooks Davis #define LUA_INT_TYPE LUA_INT_LONGLONG 158564b9ff2SBrooks Davis #endif 159564b9ff2SBrooks Davis 160564b9ff2SBrooks Davis #if !defined(LUA_FLOAT_TYPE) 161564b9ff2SBrooks Davis #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE 162564b9ff2SBrooks Davis #endif 163564b9ff2SBrooks Davis 164564b9ff2SBrooks Davis /* }================================================================== */ 165564b9ff2SBrooks Davis 166564b9ff2SBrooks Davis 167564b9ff2SBrooks Davis 168564b9ff2SBrooks Davis /* 169564b9ff2SBrooks Davis ** {================================================================== 170564b9ff2SBrooks Davis ** Configuration for Paths. 171564b9ff2SBrooks Davis ** =================================================================== 172564b9ff2SBrooks Davis */ 173564b9ff2SBrooks Davis 174564b9ff2SBrooks Davis /* 175564b9ff2SBrooks Davis ** LUA_PATH_SEP is the character that separates templates in a path. 176564b9ff2SBrooks Davis ** LUA_PATH_MARK is the string that marks the substitution points in a 177564b9ff2SBrooks Davis ** template. 178564b9ff2SBrooks Davis ** LUA_EXEC_DIR in a Windows path is replaced by the executable's 179564b9ff2SBrooks Davis ** directory. 180564b9ff2SBrooks Davis */ 181564b9ff2SBrooks Davis #define LUA_PATH_SEP ";" 182564b9ff2SBrooks Davis #define LUA_PATH_MARK "?" 183564b9ff2SBrooks Davis #define LUA_EXEC_DIR "!" 184564b9ff2SBrooks Davis 185564b9ff2SBrooks Davis 186564b9ff2SBrooks Davis /* 187564b9ff2SBrooks Davis @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for 188564b9ff2SBrooks Davis ** Lua libraries. 189564b9ff2SBrooks Davis @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for 190564b9ff2SBrooks Davis ** C libraries. 191564b9ff2SBrooks Davis ** CHANGE them if your machine has a non-conventional directory 192564b9ff2SBrooks Davis ** hierarchy or if you want to install your libraries in 193564b9ff2SBrooks Davis ** non-conventional directories. 194564b9ff2SBrooks Davis */ 1950495ed39SKyle Evans 196564b9ff2SBrooks Davis #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR 197564b9ff2SBrooks Davis #if defined(_WIN32) /* { */ 198564b9ff2SBrooks Davis /* 199564b9ff2SBrooks Davis ** In Windows, any exclamation mark ('!') in the path is replaced by the 200564b9ff2SBrooks Davis ** path of the directory of the executable file of the current process. 201564b9ff2SBrooks Davis */ 202564b9ff2SBrooks Davis #define LUA_LDIR "!\\lua\\" 203564b9ff2SBrooks Davis #define LUA_CDIR "!\\" 204564b9ff2SBrooks Davis #define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" 205*ec965063SEd Maste 2060495ed39SKyle Evans #if !defined(LUA_PATH_DEFAULT) 207564b9ff2SBrooks Davis #define LUA_PATH_DEFAULT \ 208564b9ff2SBrooks Davis LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ 209564b9ff2SBrooks Davis LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ 210564b9ff2SBrooks Davis LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ 211564b9ff2SBrooks Davis ".\\?.lua;" ".\\?\\init.lua" 2120495ed39SKyle Evans #endif 2130495ed39SKyle Evans 214*ec965063SEd Maste #if !defined(LUA_CPATH_DEFAULT) 215564b9ff2SBrooks Davis #define LUA_CPATH_DEFAULT \ 216564b9ff2SBrooks Davis LUA_CDIR"?.dll;" \ 217564b9ff2SBrooks Davis LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ 218564b9ff2SBrooks Davis LUA_CDIR"loadall.dll;" ".\\?.dll" 2190495ed39SKyle Evans #endif 220564b9ff2SBrooks Davis 221564b9ff2SBrooks Davis #else /* }{ */ 222564b9ff2SBrooks Davis 223bceabe27SEd Maste #define LUA_ROOT "/usr/" 224bceabe27SEd Maste #define LUA_LDIR LUA_ROOT "share/flua/" 225bceabe27SEd Maste #define LUA_CDIR LUA_ROOT "lib/flua/" 2260495ed39SKyle Evans 227be99f886SEd Maste #if !defined(LUA_PATH_DEFAULT) 228564b9ff2SBrooks Davis #define LUA_PATH_DEFAULT \ 229564b9ff2SBrooks Davis LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ 230564b9ff2SBrooks Davis LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ 231564b9ff2SBrooks Davis "./?.lua;" "./?/init.lua" 232be99f886SEd Maste #endif 2330495ed39SKyle Evans 234be99f886SEd Maste #if !defined(LUA_CPATH_DEFAULT) 235564b9ff2SBrooks Davis #define LUA_CPATH_DEFAULT \ 236564b9ff2SBrooks Davis LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" 237be99f886SEd Maste #endif 2380495ed39SKyle Evans 239564b9ff2SBrooks Davis #endif /* } */ 240564b9ff2SBrooks Davis 241564b9ff2SBrooks Davis 242564b9ff2SBrooks Davis /* 243564b9ff2SBrooks Davis @@ LUA_DIRSEP is the directory separator (for submodules). 244564b9ff2SBrooks Davis ** CHANGE it if your machine does not use "/" as the directory separator 245564b9ff2SBrooks Davis ** and is not Windows. (On Windows Lua automatically uses "\".) 246564b9ff2SBrooks Davis */ 2470495ed39SKyle Evans #if !defined(LUA_DIRSEP) 2480495ed39SKyle Evans 249564b9ff2SBrooks Davis #if defined(_WIN32) 250564b9ff2SBrooks Davis #define LUA_DIRSEP "\\" 251564b9ff2SBrooks Davis #else 252564b9ff2SBrooks Davis #define LUA_DIRSEP "/" 253564b9ff2SBrooks Davis #endif 254564b9ff2SBrooks Davis 2550495ed39SKyle Evans #endif 2560495ed39SKyle Evans 257564b9ff2SBrooks Davis /* }================================================================== */ 258564b9ff2SBrooks Davis 259564b9ff2SBrooks Davis 260564b9ff2SBrooks Davis /* 261564b9ff2SBrooks Davis ** {================================================================== 262564b9ff2SBrooks Davis ** Marks for exported symbols in the C code 263564b9ff2SBrooks Davis ** =================================================================== 264564b9ff2SBrooks Davis */ 265564b9ff2SBrooks Davis 266564b9ff2SBrooks Davis /* 267564b9ff2SBrooks Davis @@ LUA_API is a mark for all core API functions. 268564b9ff2SBrooks Davis @@ LUALIB_API is a mark for all auxiliary library functions. 269564b9ff2SBrooks Davis @@ LUAMOD_API is a mark for all standard library opening functions. 270564b9ff2SBrooks Davis ** CHANGE them if you need to define those functions in some special way. 271564b9ff2SBrooks Davis ** For instance, if you want to create one Windows DLL with the core and 272564b9ff2SBrooks Davis ** the libraries, you may want to use the following definition (define 273564b9ff2SBrooks Davis ** LUA_BUILD_AS_DLL to get it). 274564b9ff2SBrooks Davis */ 275564b9ff2SBrooks Davis #if defined(LUA_BUILD_AS_DLL) /* { */ 276564b9ff2SBrooks Davis 277564b9ff2SBrooks Davis #if defined(LUA_CORE) || defined(LUA_LIB) /* { */ 278564b9ff2SBrooks Davis #define LUA_API __declspec(dllexport) 279564b9ff2SBrooks Davis #else /* }{ */ 280564b9ff2SBrooks Davis #define LUA_API __declspec(dllimport) 281564b9ff2SBrooks Davis #endif /* } */ 282564b9ff2SBrooks Davis 283564b9ff2SBrooks Davis #else /* }{ */ 284564b9ff2SBrooks Davis 285564b9ff2SBrooks Davis #define LUA_API extern 286564b9ff2SBrooks Davis 287564b9ff2SBrooks Davis #endif /* } */ 288564b9ff2SBrooks Davis 289564b9ff2SBrooks Davis 2900495ed39SKyle Evans /* 2910495ed39SKyle Evans ** More often than not the libs go together with the core. 2920495ed39SKyle Evans */ 293564b9ff2SBrooks Davis #define LUALIB_API LUA_API 2940495ed39SKyle Evans #define LUAMOD_API LUA_API 295564b9ff2SBrooks Davis 296564b9ff2SBrooks Davis 297564b9ff2SBrooks Davis /* 298564b9ff2SBrooks Davis @@ LUAI_FUNC is a mark for all extern functions that are not to be 299564b9ff2SBrooks Davis ** exported to outside modules. 3000495ed39SKyle Evans @@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables, 3010495ed39SKyle Evans ** none of which to be exported to outside modules (LUAI_DDEF for 302564b9ff2SBrooks Davis ** definitions and LUAI_DDEC for declarations). 303564b9ff2SBrooks Davis ** CHANGE them if you need to mark them in some special way. Elf/gcc 304564b9ff2SBrooks Davis ** (versions 3.2 and later) mark them as "hidden" to optimize access 305564b9ff2SBrooks Davis ** when Lua is compiled as a shared library. Not all elf targets support 306564b9ff2SBrooks Davis ** this attribute. Unfortunately, gcc does not offer a way to check 307564b9ff2SBrooks Davis ** whether the target offers that support, and those without support 308564b9ff2SBrooks Davis ** give a warning about it. To avoid these warnings, change to the 309564b9ff2SBrooks Davis ** default definition. 310564b9ff2SBrooks Davis */ 311564b9ff2SBrooks Davis #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ 312564b9ff2SBrooks Davis defined(__ELF__) /* { */ 3130495ed39SKyle Evans #define LUAI_FUNC __attribute__((visibility("internal"))) extern 314564b9ff2SBrooks Davis #else /* }{ */ 315564b9ff2SBrooks Davis #define LUAI_FUNC extern 316564b9ff2SBrooks Davis #endif /* } */ 317564b9ff2SBrooks Davis 3180495ed39SKyle Evans #define LUAI_DDEC(dec) LUAI_FUNC dec 319564b9ff2SBrooks Davis #define LUAI_DDEF /* empty */ 320564b9ff2SBrooks Davis 321564b9ff2SBrooks Davis /* }================================================================== */ 322564b9ff2SBrooks Davis 323564b9ff2SBrooks Davis 324564b9ff2SBrooks Davis /* 325564b9ff2SBrooks Davis ** {================================================================== 326564b9ff2SBrooks Davis ** Compatibility with previous versions 327564b9ff2SBrooks Davis ** =================================================================== 328564b9ff2SBrooks Davis */ 329564b9ff2SBrooks Davis 330564b9ff2SBrooks Davis /* 3310495ed39SKyle Evans @@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3. 332564b9ff2SBrooks Davis ** You can define it to get all options, or change specific options 333564b9ff2SBrooks Davis ** to fit your specific needs. 334564b9ff2SBrooks Davis */ 3350495ed39SKyle Evans #if defined(LUA_COMPAT_5_3) /* { */ 336564b9ff2SBrooks Davis 337564b9ff2SBrooks Davis /* 338564b9ff2SBrooks Davis @@ LUA_COMPAT_MATHLIB controls the presence of several deprecated 339564b9ff2SBrooks Davis ** functions in the mathematical library. 3400495ed39SKyle Evans ** (These functions were already officially removed in 5.3; 3410495ed39SKyle Evans ** nevertheless they are still available here.) 342564b9ff2SBrooks Davis */ 343564b9ff2SBrooks Davis #define LUA_COMPAT_MATHLIB 344564b9ff2SBrooks Davis 345564b9ff2SBrooks Davis /* 346564b9ff2SBrooks Davis @@ LUA_COMPAT_APIINTCASTS controls the presence of macros for 347564b9ff2SBrooks Davis ** manipulating other integer types (lua_pushunsigned, lua_tounsigned, 348564b9ff2SBrooks Davis ** luaL_checkint, luaL_checklong, etc.) 3490495ed39SKyle Evans ** (These macros were also officially removed in 5.3, but they are still 3500495ed39SKyle Evans ** available here.) 351564b9ff2SBrooks Davis */ 352564b9ff2SBrooks Davis #define LUA_COMPAT_APIINTCASTS 353564b9ff2SBrooks Davis 354564b9ff2SBrooks Davis 355564b9ff2SBrooks Davis /* 3560495ed39SKyle Evans @@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod 3570495ed39SKyle Evans ** using '__lt'. 358564b9ff2SBrooks Davis */ 3590495ed39SKyle Evans #define LUA_COMPAT_LT_LE 360564b9ff2SBrooks Davis 361564b9ff2SBrooks Davis 362564b9ff2SBrooks Davis /* 363564b9ff2SBrooks Davis @@ The following macros supply trivial compatibility for some 364564b9ff2SBrooks Davis ** changes in the API. The macros themselves document how to 365564b9ff2SBrooks Davis ** change your code to avoid using them. 3660495ed39SKyle Evans ** (Once more, these macros were officially removed in 5.3, but they are 3670495ed39SKyle Evans ** still available here.) 368564b9ff2SBrooks Davis */ 369564b9ff2SBrooks Davis #define lua_strlen(L,i) lua_rawlen(L, (i)) 370564b9ff2SBrooks Davis 371564b9ff2SBrooks Davis #define lua_objlen(L,i) lua_rawlen(L, (i)) 372564b9ff2SBrooks Davis 373564b9ff2SBrooks Davis #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) 374564b9ff2SBrooks Davis #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) 375564b9ff2SBrooks Davis 376564b9ff2SBrooks Davis #endif /* } */ 377564b9ff2SBrooks Davis 378564b9ff2SBrooks Davis /* }================================================================== */ 379564b9ff2SBrooks Davis 380564b9ff2SBrooks Davis 381564b9ff2SBrooks Davis 382564b9ff2SBrooks Davis /* 383564b9ff2SBrooks Davis ** {================================================================== 384564b9ff2SBrooks Davis ** Configuration for Numbers. 385564b9ff2SBrooks Davis ** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* 386564b9ff2SBrooks Davis ** satisfy your needs. 387564b9ff2SBrooks Davis ** =================================================================== 388564b9ff2SBrooks Davis */ 389564b9ff2SBrooks Davis 390564b9ff2SBrooks Davis /* 391564b9ff2SBrooks Davis @@ LUA_NUMBER is the floating-point type used by Lua. 392564b9ff2SBrooks Davis @@ LUAI_UACNUMBER is the result of a 'default argument promotion' 393564b9ff2SBrooks Davis @@ over a floating number. 3940495ed39SKyle Evans @@ l_floatatt(x) corrects float attribute 'x' to the proper float type 395564b9ff2SBrooks Davis ** by prefixing it with one of FLT/DBL/LDBL. 396564b9ff2SBrooks Davis @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. 397564b9ff2SBrooks Davis @@ LUA_NUMBER_FMT is the format for writing floats. 398564b9ff2SBrooks Davis @@ lua_number2str converts a float to a string. 399564b9ff2SBrooks Davis @@ l_mathop allows the addition of an 'l' or 'f' to all math operations. 400564b9ff2SBrooks Davis @@ l_floor takes the floor of a float. 4010495ed39SKyle Evans @@ lua_str2number converts a decimal numeral to a number. 402564b9ff2SBrooks Davis */ 403564b9ff2SBrooks Davis 404564b9ff2SBrooks Davis 405564b9ff2SBrooks Davis /* The following definitions are good for most cases here */ 406564b9ff2SBrooks Davis 407564b9ff2SBrooks Davis #define l_floor(x) (l_mathop(floor)(x)) 408564b9ff2SBrooks Davis 409564b9ff2SBrooks Davis #define lua_number2str(s,sz,n) \ 410564b9ff2SBrooks Davis l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n)) 411564b9ff2SBrooks Davis 412564b9ff2SBrooks Davis /* 4130495ed39SKyle Evans @@ lua_numbertointeger converts a float number with an integral value 4140495ed39SKyle Evans ** to an integer, or returns 0 if float is not within the range of 4150495ed39SKyle Evans ** a lua_Integer. (The range comparisons are tricky because of 4160495ed39SKyle Evans ** rounding. The tests here assume a two-complement representation, 4170495ed39SKyle Evans ** where MININTEGER always has an exact representation as a float; 4180495ed39SKyle Evans ** MAXINTEGER may not have one, and therefore its conversion to float 4190495ed39SKyle Evans ** may have an ill-defined value.) 420564b9ff2SBrooks Davis */ 421564b9ff2SBrooks Davis #define lua_numbertointeger(n,p) \ 422564b9ff2SBrooks Davis ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ 423564b9ff2SBrooks Davis (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \ 424564b9ff2SBrooks Davis (*(p) = (LUA_INTEGER)(n), 1)) 425564b9ff2SBrooks Davis 426564b9ff2SBrooks Davis 427564b9ff2SBrooks Davis /* now the variable definitions */ 428564b9ff2SBrooks Davis 429564b9ff2SBrooks Davis #if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */ 430564b9ff2SBrooks Davis 431564b9ff2SBrooks Davis #define LUA_NUMBER float 432564b9ff2SBrooks Davis 4330495ed39SKyle Evans #define l_floatatt(n) (FLT_##n) 434564b9ff2SBrooks Davis 435564b9ff2SBrooks Davis #define LUAI_UACNUMBER double 436564b9ff2SBrooks Davis 437564b9ff2SBrooks Davis #define LUA_NUMBER_FRMLEN "" 438564b9ff2SBrooks Davis #define LUA_NUMBER_FMT "%.7g" 439564b9ff2SBrooks Davis 440564b9ff2SBrooks Davis #define l_mathop(op) op##f 441564b9ff2SBrooks Davis 442564b9ff2SBrooks Davis #define lua_str2number(s,p) strtof((s), (p)) 443564b9ff2SBrooks Davis 444564b9ff2SBrooks Davis 445564b9ff2SBrooks Davis #elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ 446564b9ff2SBrooks Davis 447564b9ff2SBrooks Davis #define LUA_NUMBER long double 448564b9ff2SBrooks Davis 4490495ed39SKyle Evans #define l_floatatt(n) (LDBL_##n) 450564b9ff2SBrooks Davis 451564b9ff2SBrooks Davis #define LUAI_UACNUMBER long double 452564b9ff2SBrooks Davis 453564b9ff2SBrooks Davis #define LUA_NUMBER_FRMLEN "L" 454564b9ff2SBrooks Davis #define LUA_NUMBER_FMT "%.19Lg" 455564b9ff2SBrooks Davis 456564b9ff2SBrooks Davis #define l_mathop(op) op##l 457564b9ff2SBrooks Davis 458564b9ff2SBrooks Davis #define lua_str2number(s,p) strtold((s), (p)) 459564b9ff2SBrooks Davis 460564b9ff2SBrooks Davis #elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */ 461564b9ff2SBrooks Davis 462564b9ff2SBrooks Davis #define LUA_NUMBER double 463564b9ff2SBrooks Davis 4640495ed39SKyle Evans #define l_floatatt(n) (DBL_##n) 465564b9ff2SBrooks Davis 466564b9ff2SBrooks Davis #define LUAI_UACNUMBER double 467564b9ff2SBrooks Davis 468564b9ff2SBrooks Davis #define LUA_NUMBER_FRMLEN "" 469564b9ff2SBrooks Davis #define LUA_NUMBER_FMT "%.14g" 470564b9ff2SBrooks Davis 471564b9ff2SBrooks Davis #define l_mathop(op) op 472564b9ff2SBrooks Davis 473564b9ff2SBrooks Davis #define lua_str2number(s,p) strtod((s), (p)) 474564b9ff2SBrooks Davis 475564b9ff2SBrooks Davis #else /* }{ */ 476564b9ff2SBrooks Davis 477564b9ff2SBrooks Davis #error "numeric float type not defined" 478564b9ff2SBrooks Davis 479564b9ff2SBrooks Davis #endif /* } */ 480564b9ff2SBrooks Davis 481564b9ff2SBrooks Davis 482564b9ff2SBrooks Davis 483564b9ff2SBrooks Davis /* 484564b9ff2SBrooks Davis @@ LUA_INTEGER is the integer type used by Lua. 485564b9ff2SBrooks Davis ** 486564b9ff2SBrooks Davis @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. 487564b9ff2SBrooks Davis ** 488564b9ff2SBrooks Davis @@ LUAI_UACINT is the result of a 'default argument promotion' 4890495ed39SKyle Evans @@ over a LUA_INTEGER. 490564b9ff2SBrooks Davis @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. 491564b9ff2SBrooks Davis @@ LUA_INTEGER_FMT is the format for writing integers. 492564b9ff2SBrooks Davis @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. 493564b9ff2SBrooks Davis @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. 4940495ed39SKyle Evans @@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED. 4950495ed39SKyle Evans @@ LUA_UNSIGNEDBITS is the number of bits in a LUA_UNSIGNED. 496564b9ff2SBrooks Davis @@ lua_integer2str converts an integer to a string. 497564b9ff2SBrooks Davis */ 498564b9ff2SBrooks Davis 499564b9ff2SBrooks Davis 500564b9ff2SBrooks Davis /* The following definitions are good for most cases here */ 501564b9ff2SBrooks Davis 502564b9ff2SBrooks Davis #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" 503564b9ff2SBrooks Davis 504564b9ff2SBrooks Davis #define LUAI_UACINT LUA_INTEGER 505564b9ff2SBrooks Davis 506564b9ff2SBrooks Davis #define lua_integer2str(s,sz,n) \ 507564b9ff2SBrooks Davis l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n)) 508564b9ff2SBrooks Davis 509564b9ff2SBrooks Davis /* 510564b9ff2SBrooks Davis ** use LUAI_UACINT here to avoid problems with promotions (which 511564b9ff2SBrooks Davis ** can turn a comparison between unsigneds into a signed comparison) 512564b9ff2SBrooks Davis */ 513564b9ff2SBrooks Davis #define LUA_UNSIGNED unsigned LUAI_UACINT 514564b9ff2SBrooks Davis 515564b9ff2SBrooks Davis 5160495ed39SKyle Evans #define LUA_UNSIGNEDBITS (sizeof(LUA_UNSIGNED) * CHAR_BIT) 5170495ed39SKyle Evans 5180495ed39SKyle Evans 519564b9ff2SBrooks Davis /* now the variable definitions */ 520564b9ff2SBrooks Davis 521564b9ff2SBrooks Davis #if LUA_INT_TYPE == LUA_INT_INT /* { int */ 522564b9ff2SBrooks Davis 523564b9ff2SBrooks Davis #define LUA_INTEGER int 524564b9ff2SBrooks Davis #define LUA_INTEGER_FRMLEN "" 525564b9ff2SBrooks Davis 526564b9ff2SBrooks Davis #define LUA_MAXINTEGER INT_MAX 527564b9ff2SBrooks Davis #define LUA_MININTEGER INT_MIN 528564b9ff2SBrooks Davis 5290495ed39SKyle Evans #define LUA_MAXUNSIGNED UINT_MAX 5300495ed39SKyle Evans 531564b9ff2SBrooks Davis #elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */ 532564b9ff2SBrooks Davis 533564b9ff2SBrooks Davis #define LUA_INTEGER long 534564b9ff2SBrooks Davis #define LUA_INTEGER_FRMLEN "l" 535564b9ff2SBrooks Davis 536564b9ff2SBrooks Davis #define LUA_MAXINTEGER LONG_MAX 537564b9ff2SBrooks Davis #define LUA_MININTEGER LONG_MIN 538564b9ff2SBrooks Davis 5390495ed39SKyle Evans #define LUA_MAXUNSIGNED ULONG_MAX 5400495ed39SKyle Evans 541564b9ff2SBrooks Davis #elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */ 542564b9ff2SBrooks Davis 543564b9ff2SBrooks Davis /* use presence of macro LLONG_MAX as proxy for C99 compliance */ 544564b9ff2SBrooks Davis #if defined(LLONG_MAX) /* { */ 545564b9ff2SBrooks Davis /* use ISO C99 stuff */ 546564b9ff2SBrooks Davis 547564b9ff2SBrooks Davis #define LUA_INTEGER long long 548564b9ff2SBrooks Davis #define LUA_INTEGER_FRMLEN "ll" 549564b9ff2SBrooks Davis 550564b9ff2SBrooks Davis #define LUA_MAXINTEGER LLONG_MAX 551564b9ff2SBrooks Davis #define LUA_MININTEGER LLONG_MIN 552564b9ff2SBrooks Davis 5530495ed39SKyle Evans #define LUA_MAXUNSIGNED ULLONG_MAX 5540495ed39SKyle Evans 555564b9ff2SBrooks Davis #elif defined(LUA_USE_WINDOWS) /* }{ */ 556564b9ff2SBrooks Davis /* in Windows, can use specific Windows types */ 557564b9ff2SBrooks Davis 558564b9ff2SBrooks Davis #define LUA_INTEGER __int64 559564b9ff2SBrooks Davis #define LUA_INTEGER_FRMLEN "I64" 560564b9ff2SBrooks Davis 561564b9ff2SBrooks Davis #define LUA_MAXINTEGER _I64_MAX 562564b9ff2SBrooks Davis #define LUA_MININTEGER _I64_MIN 563564b9ff2SBrooks Davis 5640495ed39SKyle Evans #define LUA_MAXUNSIGNED _UI64_MAX 5650495ed39SKyle Evans 566564b9ff2SBrooks Davis #else /* }{ */ 567564b9ff2SBrooks Davis 568564b9ff2SBrooks Davis #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ 569564b9ff2SBrooks Davis or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" 570564b9ff2SBrooks Davis 571564b9ff2SBrooks Davis #endif /* } */ 572564b9ff2SBrooks Davis 573564b9ff2SBrooks Davis #else /* }{ */ 574564b9ff2SBrooks Davis 575564b9ff2SBrooks Davis #error "numeric integer type not defined" 576564b9ff2SBrooks Davis 577564b9ff2SBrooks Davis #endif /* } */ 578564b9ff2SBrooks Davis 579564b9ff2SBrooks Davis /* }================================================================== */ 580564b9ff2SBrooks Davis 581564b9ff2SBrooks Davis 582564b9ff2SBrooks Davis /* 583564b9ff2SBrooks Davis ** {================================================================== 584564b9ff2SBrooks Davis ** Dependencies with C99 and other C details 585564b9ff2SBrooks Davis ** =================================================================== 586564b9ff2SBrooks Davis */ 587564b9ff2SBrooks Davis 588564b9ff2SBrooks Davis /* 589564b9ff2SBrooks Davis @@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89. 590564b9ff2SBrooks Davis ** (All uses in Lua have only one format item.) 591564b9ff2SBrooks Davis */ 592564b9ff2SBrooks Davis #if !defined(LUA_USE_C89) 593564b9ff2SBrooks Davis #define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i) 594564b9ff2SBrooks Davis #else 595564b9ff2SBrooks Davis #define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i)) 596564b9ff2SBrooks Davis #endif 597564b9ff2SBrooks Davis 598564b9ff2SBrooks Davis 599564b9ff2SBrooks Davis /* 6000495ed39SKyle Evans @@ lua_strx2number converts a hexadecimal numeral to a number. 601564b9ff2SBrooks Davis ** In C99, 'strtod' does that conversion. Otherwise, you can 602564b9ff2SBrooks Davis ** leave 'lua_strx2number' undefined and Lua will provide its own 603564b9ff2SBrooks Davis ** implementation. 604564b9ff2SBrooks Davis */ 605564b9ff2SBrooks Davis #if !defined(LUA_USE_C89) 606564b9ff2SBrooks Davis #define lua_strx2number(s,p) lua_str2number(s,p) 607564b9ff2SBrooks Davis #endif 608564b9ff2SBrooks Davis 609564b9ff2SBrooks Davis 610564b9ff2SBrooks Davis /* 611564b9ff2SBrooks Davis @@ lua_pointer2str converts a pointer to a readable string in a 612564b9ff2SBrooks Davis ** non-specified way. 613564b9ff2SBrooks Davis */ 614564b9ff2SBrooks Davis #define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) 615564b9ff2SBrooks Davis 616564b9ff2SBrooks Davis 617564b9ff2SBrooks Davis /* 6180495ed39SKyle Evans @@ lua_number2strx converts a float to a hexadecimal numeral. 619564b9ff2SBrooks Davis ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. 620564b9ff2SBrooks Davis ** Otherwise, you can leave 'lua_number2strx' undefined and Lua will 621564b9ff2SBrooks Davis ** provide its own implementation. 622564b9ff2SBrooks Davis */ 623564b9ff2SBrooks Davis #if !defined(LUA_USE_C89) 624564b9ff2SBrooks Davis #define lua_number2strx(L,b,sz,f,n) \ 625564b9ff2SBrooks Davis ((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n))) 626564b9ff2SBrooks Davis #endif 627564b9ff2SBrooks Davis 628564b9ff2SBrooks Davis 629564b9ff2SBrooks Davis /* 630564b9ff2SBrooks Davis ** 'strtof' and 'opf' variants for math functions are not valid in 631564b9ff2SBrooks Davis ** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the 632564b9ff2SBrooks Davis ** availability of these variants. ('math.h' is already included in 633564b9ff2SBrooks Davis ** all files that use these macros.) 634564b9ff2SBrooks Davis */ 635564b9ff2SBrooks Davis #if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF)) 636564b9ff2SBrooks Davis #undef l_mathop /* variants not available */ 637564b9ff2SBrooks Davis #undef lua_str2number 638564b9ff2SBrooks Davis #define l_mathop(op) (lua_Number)op /* no variant */ 639564b9ff2SBrooks Davis #define lua_str2number(s,p) ((lua_Number)strtod((s), (p))) 640564b9ff2SBrooks Davis #endif 641564b9ff2SBrooks Davis 642564b9ff2SBrooks Davis 643564b9ff2SBrooks Davis /* 644564b9ff2SBrooks Davis @@ LUA_KCONTEXT is the type of the context ('ctx') for continuation 645564b9ff2SBrooks Davis ** functions. It must be a numerical type; Lua will use 'intptr_t' if 646564b9ff2SBrooks Davis ** available, otherwise it will use 'ptrdiff_t' (the nearest thing to 647564b9ff2SBrooks Davis ** 'intptr_t' in C89) 648564b9ff2SBrooks Davis */ 649564b9ff2SBrooks Davis #define LUA_KCONTEXT ptrdiff_t 650564b9ff2SBrooks Davis 651564b9ff2SBrooks Davis #if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ 652564b9ff2SBrooks Davis __STDC_VERSION__ >= 199901L 653564b9ff2SBrooks Davis #include <stdint.h> 654564b9ff2SBrooks Davis #if defined(INTPTR_MAX) /* even in C99 this type is optional */ 655564b9ff2SBrooks Davis #undef LUA_KCONTEXT 656564b9ff2SBrooks Davis #define LUA_KCONTEXT intptr_t 657564b9ff2SBrooks Davis #endif 658564b9ff2SBrooks Davis #endif 659564b9ff2SBrooks Davis 660564b9ff2SBrooks Davis 661564b9ff2SBrooks Davis /* 662564b9ff2SBrooks Davis @@ lua_getlocaledecpoint gets the locale "radix character" (decimal point). 663564b9ff2SBrooks Davis ** Change that if you do not want to use C locales. (Code using this 6640495ed39SKyle Evans ** macro must include the header 'locale.h'.) 665564b9ff2SBrooks Davis */ 666564b9ff2SBrooks Davis #if !defined(lua_getlocaledecpoint) 667564b9ff2SBrooks Davis #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) 668564b9ff2SBrooks Davis #endif 669564b9ff2SBrooks Davis 670564b9ff2SBrooks Davis /* }================================================================== */ 671564b9ff2SBrooks Davis 672564b9ff2SBrooks Davis 673564b9ff2SBrooks Davis /* 674564b9ff2SBrooks Davis ** {================================================================== 675564b9ff2SBrooks Davis ** Language Variations 676564b9ff2SBrooks Davis ** ===================================================================== 677564b9ff2SBrooks Davis */ 678564b9ff2SBrooks Davis 679564b9ff2SBrooks Davis /* 680564b9ff2SBrooks Davis @@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some 681564b9ff2SBrooks Davis ** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from 682564b9ff2SBrooks Davis ** numbers to strings. Define LUA_NOCVTS2N to turn off automatic 683564b9ff2SBrooks Davis ** coercion from strings to numbers. 684564b9ff2SBrooks Davis */ 685564b9ff2SBrooks Davis /* #define LUA_NOCVTN2S */ 686564b9ff2SBrooks Davis /* #define LUA_NOCVTS2N */ 687564b9ff2SBrooks Davis 688564b9ff2SBrooks Davis 689564b9ff2SBrooks Davis /* 690564b9ff2SBrooks Davis @@ LUA_USE_APICHECK turns on several consistency checks on the C API. 691564b9ff2SBrooks Davis ** Define it as a help when debugging C code. 692564b9ff2SBrooks Davis */ 693564b9ff2SBrooks Davis #if defined(LUA_USE_APICHECK) 694564b9ff2SBrooks Davis #include <assert.h> 695564b9ff2SBrooks Davis #define luai_apicheck(l,e) assert(e) 696564b9ff2SBrooks Davis #endif 697564b9ff2SBrooks Davis 698564b9ff2SBrooks Davis /* }================================================================== */ 699564b9ff2SBrooks Davis 700564b9ff2SBrooks Davis 701564b9ff2SBrooks Davis /* 702564b9ff2SBrooks Davis ** {================================================================== 703564b9ff2SBrooks Davis ** Macros that affect the API and must be stable (that is, must be the 704564b9ff2SBrooks Davis ** same when you compile Lua and when you compile code that links to 7050495ed39SKyle Evans ** Lua). 706564b9ff2SBrooks Davis ** ===================================================================== 707564b9ff2SBrooks Davis */ 708564b9ff2SBrooks Davis 709564b9ff2SBrooks Davis /* 710564b9ff2SBrooks Davis @@ LUAI_MAXSTACK limits the size of the Lua stack. 711564b9ff2SBrooks Davis ** CHANGE it if you need a different limit. This limit is arbitrary; 712564b9ff2SBrooks Davis ** its only purpose is to stop Lua from consuming unlimited stack 713564b9ff2SBrooks Davis ** space (and to reserve some numbers for pseudo-indices). 7140495ed39SKyle Evans ** (It must fit into max(size_t)/32.) 715564b9ff2SBrooks Davis */ 7160495ed39SKyle Evans #if LUAI_IS32INT 717564b9ff2SBrooks Davis #define LUAI_MAXSTACK 1000000 718564b9ff2SBrooks Davis #else 719564b9ff2SBrooks Davis #define LUAI_MAXSTACK 15000 720564b9ff2SBrooks Davis #endif 721564b9ff2SBrooks Davis 722564b9ff2SBrooks Davis 723564b9ff2SBrooks Davis /* 724564b9ff2SBrooks Davis @@ LUA_EXTRASPACE defines the size of a raw memory area associated with 725564b9ff2SBrooks Davis ** a Lua state with very fast access. 726564b9ff2SBrooks Davis ** CHANGE it if you need a different size. 727564b9ff2SBrooks Davis */ 728564b9ff2SBrooks Davis #define LUA_EXTRASPACE (sizeof(void *)) 729564b9ff2SBrooks Davis 730564b9ff2SBrooks Davis 731564b9ff2SBrooks Davis /* 732564b9ff2SBrooks Davis @@ LUA_IDSIZE gives the maximum size for the description of the source 733564b9ff2SBrooks Davis @@ of a function in debug information. 734564b9ff2SBrooks Davis ** CHANGE it if you want a different size. 735564b9ff2SBrooks Davis */ 736564b9ff2SBrooks Davis #define LUA_IDSIZE 60 737564b9ff2SBrooks Davis 738564b9ff2SBrooks Davis 739564b9ff2SBrooks Davis /* 740564b9ff2SBrooks Davis @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. 741564b9ff2SBrooks Davis */ 7420495ed39SKyle Evans #define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) 743564b9ff2SBrooks Davis 744564b9ff2SBrooks Davis 745564b9ff2SBrooks Davis /* 7460495ed39SKyle Evans @@ LUAI_MAXALIGN defines fields that, when used in a union, ensure 7470495ed39SKyle Evans ** maximum alignment for the other items in that union. 748564b9ff2SBrooks Davis */ 7490495ed39SKyle Evans #define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l 7500495ed39SKyle Evans 7510495ed39SKyle Evans /* }================================================================== */ 7520495ed39SKyle Evans 753564b9ff2SBrooks Davis 754564b9ff2SBrooks Davis 755564b9ff2SBrooks Davis 756564b9ff2SBrooks Davis 757564b9ff2SBrooks Davis /* =================================================================== */ 758564b9ff2SBrooks Davis 759564b9ff2SBrooks Davis /* 760564b9ff2SBrooks Davis ** Local configuration. You can use this space to add your redefinitions 761564b9ff2SBrooks Davis ** without modifying the main part of the file. 762564b9ff2SBrooks Davis */ 763564b9ff2SBrooks Davis 764564b9ff2SBrooks Davis 765564b9ff2SBrooks Davis 766564b9ff2SBrooks Davis 767564b9ff2SBrooks Davis 768564b9ff2SBrooks Davis #endif 769564b9ff2SBrooks Davis 770