18c784bb8SWarner Losh /* 28c784bb8SWarner Losh ** $Id: luaconf.h $ 38c784bb8SWarner Losh ** Configuration file for Lua 48c784bb8SWarner Losh ** See Copyright Notice in lua.h 58c784bb8SWarner Losh */ 68c784bb8SWarner Losh 78c784bb8SWarner Losh 88c784bb8SWarner Losh #ifndef luaconf_h 98c784bb8SWarner Losh #define luaconf_h 108c784bb8SWarner Losh 118c784bb8SWarner Losh #include <limits.h> 128c784bb8SWarner Losh #include <stddef.h> 138c784bb8SWarner Losh 148c784bb8SWarner Losh 158c784bb8SWarner Losh /* 168c784bb8SWarner Losh ** =================================================================== 178c784bb8SWarner Losh ** General Configuration File for Lua 188c784bb8SWarner Losh ** 198c784bb8SWarner Losh ** Some definitions here can be changed externally, through the compiler 208c784bb8SWarner Losh ** (e.g., with '-D' options): They are commented out or protected 218c784bb8SWarner Losh ** by '#if !defined' guards. However, several other definitions 228c784bb8SWarner Losh ** should be changed directly here, either because they affect the 238c784bb8SWarner Losh ** Lua ABI (by making the changes here, you ensure that all software 248c784bb8SWarner Losh ** connected to Lua, such as C libraries, will be compiled with the same 258c784bb8SWarner Losh ** configuration); or because they are seldom changed. 268c784bb8SWarner Losh ** 278c784bb8SWarner Losh ** Search for "@@" to find all configurable definitions. 288c784bb8SWarner Losh ** =================================================================== 298c784bb8SWarner Losh */ 308c784bb8SWarner Losh 318c784bb8SWarner Losh 328c784bb8SWarner Losh /* 338c784bb8SWarner Losh ** {==================================================================== 348c784bb8SWarner Losh ** System Configuration: macros to adapt (if needed) Lua to some 358c784bb8SWarner Losh ** particular platform, for instance restricting it to C89. 368c784bb8SWarner Losh ** ===================================================================== 378c784bb8SWarner Losh */ 388c784bb8SWarner Losh 398c784bb8SWarner Losh /* 408c784bb8SWarner Losh @@ LUA_USE_C89 controls the use of non-ISO-C89 features. 418c784bb8SWarner Losh ** Define it if you want Lua to avoid the use of a few C99 features 428c784bb8SWarner Losh ** or Windows-specific features on Windows. 438c784bb8SWarner Losh */ 448c784bb8SWarner Losh /* #define LUA_USE_C89 */ 458c784bb8SWarner Losh 468c784bb8SWarner Losh 478c784bb8SWarner Losh /* 488c784bb8SWarner Losh ** By default, Lua on Windows use (some) specific Windows features 498c784bb8SWarner Losh */ 508c784bb8SWarner Losh #if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) 518c784bb8SWarner Losh #define LUA_USE_WINDOWS /* enable goodies for regular Windows */ 528c784bb8SWarner Losh #endif 538c784bb8SWarner Losh 548c784bb8SWarner Losh 558c784bb8SWarner Losh #if defined(LUA_USE_WINDOWS) 568c784bb8SWarner Losh #define LUA_DL_DLL /* enable support for DLL */ 578c784bb8SWarner Losh #define LUA_USE_C89 /* broadly, Windows is C89 */ 588c784bb8SWarner Losh #endif 598c784bb8SWarner Losh 608c784bb8SWarner Losh 618c784bb8SWarner Losh #if defined(LUA_USE_LINUX) 628c784bb8SWarner Losh #define LUA_USE_POSIX 638c784bb8SWarner Losh #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ 648c784bb8SWarner Losh #endif 658c784bb8SWarner Losh 668c784bb8SWarner Losh 678c784bb8SWarner Losh #if defined(LUA_USE_MACOSX) 688c784bb8SWarner Losh #define LUA_USE_POSIX 698c784bb8SWarner Losh #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ 708c784bb8SWarner Losh #endif 718c784bb8SWarner Losh 728c784bb8SWarner Losh 73*a9490b81SWarner Losh #if defined(LUA_USE_IOS) 74*a9490b81SWarner Losh #define LUA_USE_POSIX 75*a9490b81SWarner Losh #define LUA_USE_DLOPEN 76*a9490b81SWarner Losh #endif 77*a9490b81SWarner Losh 78*a9490b81SWarner Losh 798c784bb8SWarner Losh /* 808c784bb8SWarner Losh @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. 818c784bb8SWarner Losh */ 828c784bb8SWarner Losh #define LUAI_IS32INT ((UINT_MAX >> 30) >= 3) 838c784bb8SWarner Losh 848c784bb8SWarner Losh /* }================================================================== */ 858c784bb8SWarner Losh 868c784bb8SWarner Losh 878c784bb8SWarner Losh 888c784bb8SWarner Losh /* 898c784bb8SWarner Losh ** {================================================================== 908c784bb8SWarner Losh ** Configuration for Number types. These options should not be 918c784bb8SWarner Losh ** set externally, because any other code connected to Lua must 928c784bb8SWarner Losh ** use the same configuration. 938c784bb8SWarner Losh ** =================================================================== 948c784bb8SWarner Losh */ 958c784bb8SWarner Losh 968c784bb8SWarner Losh /* 978c784bb8SWarner Losh @@ LUA_INT_TYPE defines the type for Lua integers. 988c784bb8SWarner Losh @@ LUA_FLOAT_TYPE defines the type for Lua floats. 998c784bb8SWarner Losh ** Lua should work fine with any mix of these options supported 1008c784bb8SWarner Losh ** by your C compiler. The usual configurations are 64-bit integers 1018c784bb8SWarner Losh ** and 'double' (the default), 32-bit integers and 'float' (for 1028c784bb8SWarner Losh ** restricted platforms), and 'long'/'double' (for C compilers not 1038c784bb8SWarner Losh ** compliant with C99, which may not have support for 'long long'). 1048c784bb8SWarner Losh */ 1058c784bb8SWarner Losh 1068c784bb8SWarner Losh /* predefined options for LUA_INT_TYPE */ 1078c784bb8SWarner Losh #define LUA_INT_INT 1 1088c784bb8SWarner Losh #define LUA_INT_LONG 2 1098c784bb8SWarner Losh #define LUA_INT_LONGLONG 3 1108c784bb8SWarner Losh 1118c784bb8SWarner Losh /* predefined options for LUA_FLOAT_TYPE */ 1128c784bb8SWarner Losh #define LUA_FLOAT_FLOAT 1 1138c784bb8SWarner Losh #define LUA_FLOAT_DOUBLE 2 1148c784bb8SWarner Losh #define LUA_FLOAT_LONGDOUBLE 3 1158c784bb8SWarner Losh 1168c784bb8SWarner Losh 1178c784bb8SWarner Losh /* Default configuration ('long long' and 'double', for 64-bit Lua) */ 1188c784bb8SWarner Losh #define LUA_INT_DEFAULT LUA_INT_LONGLONG 1198c784bb8SWarner Losh #define LUA_FLOAT_DEFAULT LUA_FLOAT_DOUBLE 1208c784bb8SWarner Losh 1218c784bb8SWarner Losh 1228c784bb8SWarner Losh /* 1238c784bb8SWarner Losh @@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. 1248c784bb8SWarner Losh */ 1258c784bb8SWarner Losh #define LUA_32BITS 0 1268c784bb8SWarner Losh 1278c784bb8SWarner Losh 1288c784bb8SWarner Losh /* 1298c784bb8SWarner Losh @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for 1308c784bb8SWarner Losh ** C89 ('long' and 'double'); Windows always has '__int64', so it does 1318c784bb8SWarner Losh ** not need to use this case. 1328c784bb8SWarner Losh */ 1338c784bb8SWarner Losh #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) 1348c784bb8SWarner Losh #define LUA_C89_NUMBERS 1 1358c784bb8SWarner Losh #else 1368c784bb8SWarner Losh #define LUA_C89_NUMBERS 0 1378c784bb8SWarner Losh #endif 1388c784bb8SWarner Losh 1398c784bb8SWarner Losh 1408c784bb8SWarner Losh #if LUA_32BITS /* { */ 1418c784bb8SWarner Losh /* 1428c784bb8SWarner Losh ** 32-bit integers and 'float' 1438c784bb8SWarner Losh */ 1448c784bb8SWarner Losh #if LUAI_IS32INT /* use 'int' if big enough */ 1458c784bb8SWarner Losh #define LUA_INT_TYPE LUA_INT_INT 1468c784bb8SWarner Losh #else /* otherwise use 'long' */ 1478c784bb8SWarner Losh #define LUA_INT_TYPE LUA_INT_LONG 1488c784bb8SWarner Losh #endif 1498c784bb8SWarner Losh #define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT 1508c784bb8SWarner Losh 1518c784bb8SWarner Losh #elif LUA_C89_NUMBERS /* }{ */ 1528c784bb8SWarner Losh /* 1538c784bb8SWarner Losh ** largest types available for C89 ('long' and 'double') 1548c784bb8SWarner Losh */ 1558c784bb8SWarner Losh #define LUA_INT_TYPE LUA_INT_LONG 1568c784bb8SWarner Losh #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE 1578c784bb8SWarner Losh 1588c784bb8SWarner Losh #else /* }{ */ 1598c784bb8SWarner Losh /* use defaults */ 1608c784bb8SWarner Losh 1618c784bb8SWarner Losh #define LUA_INT_TYPE LUA_INT_DEFAULT 1628c784bb8SWarner Losh #define LUA_FLOAT_TYPE LUA_FLOAT_DEFAULT 1638c784bb8SWarner Losh 1648c784bb8SWarner Losh #endif /* } */ 1658c784bb8SWarner Losh 1668c784bb8SWarner Losh 1678c784bb8SWarner Losh /* }================================================================== */ 1688c784bb8SWarner Losh 1698c784bb8SWarner Losh 1708c784bb8SWarner Losh 1718c784bb8SWarner Losh /* 1728c784bb8SWarner Losh ** {================================================================== 1738c784bb8SWarner Losh ** Configuration for Paths. 1748c784bb8SWarner Losh ** =================================================================== 1758c784bb8SWarner Losh */ 1768c784bb8SWarner Losh 1778c784bb8SWarner Losh /* 1788c784bb8SWarner Losh ** LUA_PATH_SEP is the character that separates templates in a path. 1798c784bb8SWarner Losh ** LUA_PATH_MARK is the string that marks the substitution points in a 1808c784bb8SWarner Losh ** template. 1818c784bb8SWarner Losh ** LUA_EXEC_DIR in a Windows path is replaced by the executable's 1828c784bb8SWarner Losh ** directory. 1838c784bb8SWarner Losh */ 1848c784bb8SWarner Losh #define LUA_PATH_SEP ";" 1858c784bb8SWarner Losh #define LUA_PATH_MARK "?" 1868c784bb8SWarner Losh #define LUA_EXEC_DIR "!" 1878c784bb8SWarner Losh 1888c784bb8SWarner Losh 1898c784bb8SWarner Losh /* 1908c784bb8SWarner Losh @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for 1918c784bb8SWarner Losh ** Lua libraries. 1928c784bb8SWarner Losh @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for 1938c784bb8SWarner Losh ** C libraries. 1948c784bb8SWarner Losh ** CHANGE them if your machine has a non-conventional directory 1958c784bb8SWarner Losh ** hierarchy or if you want to install your libraries in 1968c784bb8SWarner Losh ** non-conventional directories. 1978c784bb8SWarner Losh */ 1988c784bb8SWarner Losh 1998c784bb8SWarner Losh #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR 2008c784bb8SWarner Losh #if defined(_WIN32) /* { */ 2018c784bb8SWarner Losh /* 2028c784bb8SWarner Losh ** In Windows, any exclamation mark ('!') in the path is replaced by the 2038c784bb8SWarner Losh ** path of the directory of the executable file of the current process. 2048c784bb8SWarner Losh */ 2058c784bb8SWarner Losh #define LUA_LDIR "!\\lua\\" 2068c784bb8SWarner Losh #define LUA_CDIR "!\\" 2078c784bb8SWarner Losh #define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" 2088c784bb8SWarner Losh 2098c784bb8SWarner Losh #if !defined(LUA_PATH_DEFAULT) 2108c784bb8SWarner Losh #define LUA_PATH_DEFAULT \ 2118c784bb8SWarner Losh LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ 2128c784bb8SWarner Losh LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ 2138c784bb8SWarner Losh LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ 2148c784bb8SWarner Losh ".\\?.lua;" ".\\?\\init.lua" 2158c784bb8SWarner Losh #endif 2168c784bb8SWarner Losh 2178c784bb8SWarner Losh #if !defined(LUA_CPATH_DEFAULT) 2188c784bb8SWarner Losh #define LUA_CPATH_DEFAULT \ 2198c784bb8SWarner Losh LUA_CDIR"?.dll;" \ 2208c784bb8SWarner Losh LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ 2218c784bb8SWarner Losh LUA_CDIR"loadall.dll;" ".\\?.dll" 2228c784bb8SWarner Losh #endif 2238c784bb8SWarner Losh 2248c784bb8SWarner Losh #else /* }{ */ 2258c784bb8SWarner Losh 2268c784bb8SWarner Losh #define LUA_ROOT "/usr/local/" 2278c784bb8SWarner Losh #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" 2288c784bb8SWarner Losh #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" 2298c784bb8SWarner Losh 2308c784bb8SWarner Losh #if !defined(LUA_PATH_DEFAULT) 2318c784bb8SWarner Losh #define LUA_PATH_DEFAULT \ 2328c784bb8SWarner Losh LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ 2338c784bb8SWarner Losh LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ 2348c784bb8SWarner Losh "./?.lua;" "./?/init.lua" 2358c784bb8SWarner Losh #endif 2368c784bb8SWarner Losh 2378c784bb8SWarner Losh #if !defined(LUA_CPATH_DEFAULT) 2388c784bb8SWarner Losh #define LUA_CPATH_DEFAULT \ 2398c784bb8SWarner Losh LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" 2408c784bb8SWarner Losh #endif 2418c784bb8SWarner Losh 2428c784bb8SWarner Losh #endif /* } */ 2438c784bb8SWarner Losh 2448c784bb8SWarner Losh 2458c784bb8SWarner Losh /* 2468c784bb8SWarner Losh @@ LUA_DIRSEP is the directory separator (for submodules). 2478c784bb8SWarner Losh ** CHANGE it if your machine does not use "/" as the directory separator 2488c784bb8SWarner Losh ** and is not Windows. (On Windows Lua automatically uses "\".) 2498c784bb8SWarner Losh */ 2508c784bb8SWarner Losh #if !defined(LUA_DIRSEP) 2518c784bb8SWarner Losh 2528c784bb8SWarner Losh #if defined(_WIN32) 2538c784bb8SWarner Losh #define LUA_DIRSEP "\\" 2548c784bb8SWarner Losh #else 2558c784bb8SWarner Losh #define LUA_DIRSEP "/" 2568c784bb8SWarner Losh #endif 2578c784bb8SWarner Losh 2588c784bb8SWarner Losh #endif 2598c784bb8SWarner Losh 2608c784bb8SWarner Losh /* }================================================================== */ 2618c784bb8SWarner Losh 2628c784bb8SWarner Losh 2638c784bb8SWarner Losh /* 2648c784bb8SWarner Losh ** {================================================================== 2658c784bb8SWarner Losh ** Marks for exported symbols in the C code 2668c784bb8SWarner Losh ** =================================================================== 2678c784bb8SWarner Losh */ 2688c784bb8SWarner Losh 2698c784bb8SWarner Losh /* 2708c784bb8SWarner Losh @@ LUA_API is a mark for all core API functions. 2718c784bb8SWarner Losh @@ LUALIB_API is a mark for all auxiliary library functions. 2728c784bb8SWarner Losh @@ LUAMOD_API is a mark for all standard library opening functions. 2738c784bb8SWarner Losh ** CHANGE them if you need to define those functions in some special way. 2748c784bb8SWarner Losh ** For instance, if you want to create one Windows DLL with the core and 2758c784bb8SWarner Losh ** the libraries, you may want to use the following definition (define 2768c784bb8SWarner Losh ** LUA_BUILD_AS_DLL to get it). 2778c784bb8SWarner Losh */ 2788c784bb8SWarner Losh #if defined(LUA_BUILD_AS_DLL) /* { */ 2798c784bb8SWarner Losh 2808c784bb8SWarner Losh #if defined(LUA_CORE) || defined(LUA_LIB) /* { */ 2818c784bb8SWarner Losh #define LUA_API __declspec(dllexport) 2828c784bb8SWarner Losh #else /* }{ */ 2838c784bb8SWarner Losh #define LUA_API __declspec(dllimport) 2848c784bb8SWarner Losh #endif /* } */ 2858c784bb8SWarner Losh 2868c784bb8SWarner Losh #else /* }{ */ 2878c784bb8SWarner Losh 2888c784bb8SWarner Losh #define LUA_API extern 2898c784bb8SWarner Losh 2908c784bb8SWarner Losh #endif /* } */ 2918c784bb8SWarner Losh 2928c784bb8SWarner Losh 2938c784bb8SWarner Losh /* 2948c784bb8SWarner Losh ** More often than not the libs go together with the core. 2958c784bb8SWarner Losh */ 2968c784bb8SWarner Losh #define LUALIB_API LUA_API 2978c784bb8SWarner Losh #define LUAMOD_API LUA_API 2988c784bb8SWarner Losh 2998c784bb8SWarner Losh 3008c784bb8SWarner Losh /* 3018c784bb8SWarner Losh @@ LUAI_FUNC is a mark for all extern functions that are not to be 3028c784bb8SWarner Losh ** exported to outside modules. 3038c784bb8SWarner Losh @@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables, 3048c784bb8SWarner Losh ** none of which to be exported to outside modules (LUAI_DDEF for 3058c784bb8SWarner Losh ** definitions and LUAI_DDEC for declarations). 3068c784bb8SWarner Losh ** CHANGE them if you need to mark them in some special way. Elf/gcc 3078c784bb8SWarner Losh ** (versions 3.2 and later) mark them as "hidden" to optimize access 3088c784bb8SWarner Losh ** when Lua is compiled as a shared library. Not all elf targets support 3098c784bb8SWarner Losh ** this attribute. Unfortunately, gcc does not offer a way to check 3108c784bb8SWarner Losh ** whether the target offers that support, and those without support 3118c784bb8SWarner Losh ** give a warning about it. To avoid these warnings, change to the 3128c784bb8SWarner Losh ** default definition. 3138c784bb8SWarner Losh */ 3148c784bb8SWarner Losh #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ 3158c784bb8SWarner Losh defined(__ELF__) /* { */ 3168c784bb8SWarner Losh #define LUAI_FUNC __attribute__((visibility("internal"))) extern 3178c784bb8SWarner Losh #else /* }{ */ 3188c784bb8SWarner Losh #define LUAI_FUNC extern 3198c784bb8SWarner Losh #endif /* } */ 3208c784bb8SWarner Losh 3218c784bb8SWarner Losh #define LUAI_DDEC(dec) LUAI_FUNC dec 3228c784bb8SWarner Losh #define LUAI_DDEF /* empty */ 3238c784bb8SWarner Losh 3248c784bb8SWarner Losh /* }================================================================== */ 3258c784bb8SWarner Losh 3268c784bb8SWarner Losh 3278c784bb8SWarner Losh /* 3288c784bb8SWarner Losh ** {================================================================== 3298c784bb8SWarner Losh ** Compatibility with previous versions 3308c784bb8SWarner Losh ** =================================================================== 3318c784bb8SWarner Losh */ 3328c784bb8SWarner Losh 3338c784bb8SWarner Losh /* 3348c784bb8SWarner Losh @@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3. 3358c784bb8SWarner Losh ** You can define it to get all options, or change specific options 3368c784bb8SWarner Losh ** to fit your specific needs. 3378c784bb8SWarner Losh */ 3388c784bb8SWarner Losh #if defined(LUA_COMPAT_5_3) /* { */ 3398c784bb8SWarner Losh 3408c784bb8SWarner Losh /* 3418c784bb8SWarner Losh @@ LUA_COMPAT_MATHLIB controls the presence of several deprecated 3428c784bb8SWarner Losh ** functions in the mathematical library. 3438c784bb8SWarner Losh ** (These functions were already officially removed in 5.3; 3448c784bb8SWarner Losh ** nevertheless they are still available here.) 3458c784bb8SWarner Losh */ 3468c784bb8SWarner Losh #define LUA_COMPAT_MATHLIB 3478c784bb8SWarner Losh 3488c784bb8SWarner Losh /* 3498c784bb8SWarner Losh @@ LUA_COMPAT_APIINTCASTS controls the presence of macros for 3508c784bb8SWarner Losh ** manipulating other integer types (lua_pushunsigned, lua_tounsigned, 3518c784bb8SWarner Losh ** luaL_checkint, luaL_checklong, etc.) 3528c784bb8SWarner Losh ** (These macros were also officially removed in 5.3, but they are still 3538c784bb8SWarner Losh ** available here.) 3548c784bb8SWarner Losh */ 3558c784bb8SWarner Losh #define LUA_COMPAT_APIINTCASTS 3568c784bb8SWarner Losh 3578c784bb8SWarner Losh 3588c784bb8SWarner Losh /* 3598c784bb8SWarner Losh @@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod 3608c784bb8SWarner Losh ** using '__lt'. 3618c784bb8SWarner Losh */ 3628c784bb8SWarner Losh #define LUA_COMPAT_LT_LE 3638c784bb8SWarner Losh 3648c784bb8SWarner Losh 3658c784bb8SWarner Losh /* 3668c784bb8SWarner Losh @@ The following macros supply trivial compatibility for some 3678c784bb8SWarner Losh ** changes in the API. The macros themselves document how to 3688c784bb8SWarner Losh ** change your code to avoid using them. 3698c784bb8SWarner Losh ** (Once more, these macros were officially removed in 5.3, but they are 3708c784bb8SWarner Losh ** still available here.) 3718c784bb8SWarner Losh */ 3728c784bb8SWarner Losh #define lua_strlen(L,i) lua_rawlen(L, (i)) 3738c784bb8SWarner Losh 3748c784bb8SWarner Losh #define lua_objlen(L,i) lua_rawlen(L, (i)) 3758c784bb8SWarner Losh 3768c784bb8SWarner Losh #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) 3778c784bb8SWarner Losh #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) 3788c784bb8SWarner Losh 3798c784bb8SWarner Losh #endif /* } */ 3808c784bb8SWarner Losh 3818c784bb8SWarner Losh /* }================================================================== */ 3828c784bb8SWarner Losh 3838c784bb8SWarner Losh 3848c784bb8SWarner Losh 3858c784bb8SWarner Losh /* 3868c784bb8SWarner Losh ** {================================================================== 3878c784bb8SWarner Losh ** Configuration for Numbers (low-level part). 3888c784bb8SWarner Losh ** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* 3898c784bb8SWarner Losh ** satisfy your needs. 3908c784bb8SWarner Losh ** =================================================================== 3918c784bb8SWarner Losh */ 3928c784bb8SWarner Losh 3938c784bb8SWarner Losh /* 3948c784bb8SWarner Losh @@ LUAI_UACNUMBER is the result of a 'default argument promotion' 3958c784bb8SWarner Losh @@ over a floating number. 3968c784bb8SWarner Losh @@ l_floatatt(x) corrects float attribute 'x' to the proper float type 3978c784bb8SWarner Losh ** by prefixing it with one of FLT/DBL/LDBL. 3988c784bb8SWarner Losh @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. 3998c784bb8SWarner Losh @@ LUA_NUMBER_FMT is the format for writing floats. 4008c784bb8SWarner Losh @@ lua_number2str converts a float to a string. 4018c784bb8SWarner Losh @@ l_mathop allows the addition of an 'l' or 'f' to all math operations. 4028c784bb8SWarner Losh @@ l_floor takes the floor of a float. 4038c784bb8SWarner Losh @@ lua_str2number converts a decimal numeral to a number. 4048c784bb8SWarner Losh */ 4058c784bb8SWarner Losh 4068c784bb8SWarner Losh 4078c784bb8SWarner Losh /* The following definitions are good for most cases here */ 4088c784bb8SWarner Losh 4098c784bb8SWarner Losh #define l_floor(x) (l_mathop(floor)(x)) 4108c784bb8SWarner Losh 4118c784bb8SWarner Losh #define lua_number2str(s,sz,n) \ 4128c784bb8SWarner Losh l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n)) 4138c784bb8SWarner Losh 4148c784bb8SWarner Losh /* 4158c784bb8SWarner Losh @@ lua_numbertointeger converts a float number with an integral value 4168c784bb8SWarner Losh ** to an integer, or returns 0 if float is not within the range of 4178c784bb8SWarner Losh ** a lua_Integer. (The range comparisons are tricky because of 4188c784bb8SWarner Losh ** rounding. The tests here assume a two-complement representation, 4198c784bb8SWarner Losh ** where MININTEGER always has an exact representation as a float; 4208c784bb8SWarner Losh ** MAXINTEGER may not have one, and therefore its conversion to float 4218c784bb8SWarner Losh ** may have an ill-defined value.) 4228c784bb8SWarner Losh */ 4238c784bb8SWarner Losh #define lua_numbertointeger(n,p) \ 4248c784bb8SWarner Losh ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ 4258c784bb8SWarner Losh (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \ 4268c784bb8SWarner Losh (*(p) = (LUA_INTEGER)(n), 1)) 4278c784bb8SWarner Losh 4288c784bb8SWarner Losh 4298c784bb8SWarner Losh /* now the variable definitions */ 4308c784bb8SWarner Losh 4318c784bb8SWarner Losh #if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */ 4328c784bb8SWarner Losh 4338c784bb8SWarner Losh #define LUA_NUMBER float 4348c784bb8SWarner Losh 4358c784bb8SWarner Losh #define l_floatatt(n) (FLT_##n) 4368c784bb8SWarner Losh 4378c784bb8SWarner Losh #define LUAI_UACNUMBER double 4388c784bb8SWarner Losh 4398c784bb8SWarner Losh #define LUA_NUMBER_FRMLEN "" 4408c784bb8SWarner Losh #define LUA_NUMBER_FMT "%.7g" 4418c784bb8SWarner Losh 4428c784bb8SWarner Losh #define l_mathop(op) op##f 4438c784bb8SWarner Losh 4448c784bb8SWarner Losh #define lua_str2number(s,p) strtof((s), (p)) 4458c784bb8SWarner Losh 4468c784bb8SWarner Losh 4478c784bb8SWarner Losh #elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ 4488c784bb8SWarner Losh 4498c784bb8SWarner Losh #define LUA_NUMBER long double 4508c784bb8SWarner Losh 4518c784bb8SWarner Losh #define l_floatatt(n) (LDBL_##n) 4528c784bb8SWarner Losh 4538c784bb8SWarner Losh #define LUAI_UACNUMBER long double 4548c784bb8SWarner Losh 4558c784bb8SWarner Losh #define LUA_NUMBER_FRMLEN "L" 4568c784bb8SWarner Losh #define LUA_NUMBER_FMT "%.19Lg" 4578c784bb8SWarner Losh 4588c784bb8SWarner Losh #define l_mathop(op) op##l 4598c784bb8SWarner Losh 4608c784bb8SWarner Losh #define lua_str2number(s,p) strtold((s), (p)) 4618c784bb8SWarner Losh 4628c784bb8SWarner Losh #elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */ 4638c784bb8SWarner Losh 4648c784bb8SWarner Losh #define LUA_NUMBER double 4658c784bb8SWarner Losh 4668c784bb8SWarner Losh #define l_floatatt(n) (DBL_##n) 4678c784bb8SWarner Losh 4688c784bb8SWarner Losh #define LUAI_UACNUMBER double 4698c784bb8SWarner Losh 4708c784bb8SWarner Losh #define LUA_NUMBER_FRMLEN "" 4718c784bb8SWarner Losh #define LUA_NUMBER_FMT "%.14g" 4728c784bb8SWarner Losh 4738c784bb8SWarner Losh #define l_mathop(op) op 4748c784bb8SWarner Losh 4758c784bb8SWarner Losh #define lua_str2number(s,p) strtod((s), (p)) 4768c784bb8SWarner Losh 4778c784bb8SWarner Losh #else /* }{ */ 4788c784bb8SWarner Losh 4798c784bb8SWarner Losh #error "numeric float type not defined" 4808c784bb8SWarner Losh 4818c784bb8SWarner Losh #endif /* } */ 4828c784bb8SWarner Losh 4838c784bb8SWarner Losh 4848c784bb8SWarner Losh 4858c784bb8SWarner Losh /* 4868c784bb8SWarner Losh @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. 4878c784bb8SWarner Losh @@ LUAI_UACINT is the result of a 'default argument promotion' 4888c784bb8SWarner Losh @@ over a LUA_INTEGER. 4898c784bb8SWarner Losh @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. 4908c784bb8SWarner Losh @@ LUA_INTEGER_FMT is the format for writing integers. 4918c784bb8SWarner Losh @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. 4928c784bb8SWarner Losh @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. 4938c784bb8SWarner Losh @@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED. 4948c784bb8SWarner Losh @@ lua_integer2str converts an integer to a string. 4958c784bb8SWarner Losh */ 4968c784bb8SWarner Losh 4978c784bb8SWarner Losh 4988c784bb8SWarner Losh /* The following definitions are good for most cases here */ 4998c784bb8SWarner Losh 5008c784bb8SWarner Losh #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" 5018c784bb8SWarner Losh 5028c784bb8SWarner Losh #define LUAI_UACINT LUA_INTEGER 5038c784bb8SWarner Losh 5048c784bb8SWarner Losh #define lua_integer2str(s,sz,n) \ 5058c784bb8SWarner Losh l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n)) 5068c784bb8SWarner Losh 5078c784bb8SWarner Losh /* 5088c784bb8SWarner Losh ** use LUAI_UACINT here to avoid problems with promotions (which 5098c784bb8SWarner Losh ** can turn a comparison between unsigneds into a signed comparison) 5108c784bb8SWarner Losh */ 5118c784bb8SWarner Losh #define LUA_UNSIGNED unsigned LUAI_UACINT 5128c784bb8SWarner Losh 5138c784bb8SWarner Losh 5148c784bb8SWarner Losh /* now the variable definitions */ 5158c784bb8SWarner Losh 5168c784bb8SWarner Losh #if LUA_INT_TYPE == LUA_INT_INT /* { int */ 5178c784bb8SWarner Losh 5188c784bb8SWarner Losh #define LUA_INTEGER int 5198c784bb8SWarner Losh #define LUA_INTEGER_FRMLEN "" 5208c784bb8SWarner Losh 5218c784bb8SWarner Losh #define LUA_MAXINTEGER INT_MAX 5228c784bb8SWarner Losh #define LUA_MININTEGER INT_MIN 5238c784bb8SWarner Losh 5248c784bb8SWarner Losh #define LUA_MAXUNSIGNED UINT_MAX 5258c784bb8SWarner Losh 5268c784bb8SWarner Losh #elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */ 5278c784bb8SWarner Losh 5288c784bb8SWarner Losh #define LUA_INTEGER long 5298c784bb8SWarner Losh #define LUA_INTEGER_FRMLEN "l" 5308c784bb8SWarner Losh 5318c784bb8SWarner Losh #define LUA_MAXINTEGER LONG_MAX 5328c784bb8SWarner Losh #define LUA_MININTEGER LONG_MIN 5338c784bb8SWarner Losh 5348c784bb8SWarner Losh #define LUA_MAXUNSIGNED ULONG_MAX 5358c784bb8SWarner Losh 5368c784bb8SWarner Losh #elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */ 5378c784bb8SWarner Losh 5388c784bb8SWarner Losh /* use presence of macro LLONG_MAX as proxy for C99 compliance */ 5398c784bb8SWarner Losh #if defined(LLONG_MAX) /* { */ 5408c784bb8SWarner Losh /* use ISO C99 stuff */ 5418c784bb8SWarner Losh 5428c784bb8SWarner Losh #define LUA_INTEGER long long 5438c784bb8SWarner Losh #define LUA_INTEGER_FRMLEN "ll" 5448c784bb8SWarner Losh 5458c784bb8SWarner Losh #define LUA_MAXINTEGER LLONG_MAX 5468c784bb8SWarner Losh #define LUA_MININTEGER LLONG_MIN 5478c784bb8SWarner Losh 5488c784bb8SWarner Losh #define LUA_MAXUNSIGNED ULLONG_MAX 5498c784bb8SWarner Losh 5508c784bb8SWarner Losh #elif defined(LUA_USE_WINDOWS) /* }{ */ 5518c784bb8SWarner Losh /* in Windows, can use specific Windows types */ 5528c784bb8SWarner Losh 5538c784bb8SWarner Losh #define LUA_INTEGER __int64 5548c784bb8SWarner Losh #define LUA_INTEGER_FRMLEN "I64" 5558c784bb8SWarner Losh 5568c784bb8SWarner Losh #define LUA_MAXINTEGER _I64_MAX 5578c784bb8SWarner Losh #define LUA_MININTEGER _I64_MIN 5588c784bb8SWarner Losh 5598c784bb8SWarner Losh #define LUA_MAXUNSIGNED _UI64_MAX 5608c784bb8SWarner Losh 5618c784bb8SWarner Losh #else /* }{ */ 5628c784bb8SWarner Losh 5638c784bb8SWarner Losh #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ 5648c784bb8SWarner Losh or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" 5658c784bb8SWarner Losh 5668c784bb8SWarner Losh #endif /* } */ 5678c784bb8SWarner Losh 5688c784bb8SWarner Losh #else /* }{ */ 5698c784bb8SWarner Losh 5708c784bb8SWarner Losh #error "numeric integer type not defined" 5718c784bb8SWarner Losh 5728c784bb8SWarner Losh #endif /* } */ 5738c784bb8SWarner Losh 5748c784bb8SWarner Losh /* }================================================================== */ 5758c784bb8SWarner Losh 5768c784bb8SWarner Losh 5778c784bb8SWarner Losh /* 5788c784bb8SWarner Losh ** {================================================================== 5798c784bb8SWarner Losh ** Dependencies with C99 and other C details 5808c784bb8SWarner Losh ** =================================================================== 5818c784bb8SWarner Losh */ 5828c784bb8SWarner Losh 5838c784bb8SWarner Losh /* 5848c784bb8SWarner Losh @@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89. 5858c784bb8SWarner Losh ** (All uses in Lua have only one format item.) 5868c784bb8SWarner Losh */ 5878c784bb8SWarner Losh #if !defined(LUA_USE_C89) 5888c784bb8SWarner Losh #define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i) 5898c784bb8SWarner Losh #else 5908c784bb8SWarner Losh #define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i)) 5918c784bb8SWarner Losh #endif 5928c784bb8SWarner Losh 5938c784bb8SWarner Losh 5948c784bb8SWarner Losh /* 5958c784bb8SWarner Losh @@ lua_strx2number converts a hexadecimal numeral to a number. 5968c784bb8SWarner Losh ** In C99, 'strtod' does that conversion. Otherwise, you can 5978c784bb8SWarner Losh ** leave 'lua_strx2number' undefined and Lua will provide its own 5988c784bb8SWarner Losh ** implementation. 5998c784bb8SWarner Losh */ 6008c784bb8SWarner Losh #if !defined(LUA_USE_C89) 6018c784bb8SWarner Losh #define lua_strx2number(s,p) lua_str2number(s,p) 6028c784bb8SWarner Losh #endif 6038c784bb8SWarner Losh 6048c784bb8SWarner Losh 6058c784bb8SWarner Losh /* 6068c784bb8SWarner Losh @@ lua_pointer2str converts a pointer to a readable string in a 6078c784bb8SWarner Losh ** non-specified way. 6088c784bb8SWarner Losh */ 6098c784bb8SWarner Losh #define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) 6108c784bb8SWarner Losh 6118c784bb8SWarner Losh 6128c784bb8SWarner Losh /* 6138c784bb8SWarner Losh @@ lua_number2strx converts a float to a hexadecimal numeral. 6148c784bb8SWarner Losh ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. 6158c784bb8SWarner Losh ** Otherwise, you can leave 'lua_number2strx' undefined and Lua will 6168c784bb8SWarner Losh ** provide its own implementation. 6178c784bb8SWarner Losh */ 6188c784bb8SWarner Losh #if !defined(LUA_USE_C89) 6198c784bb8SWarner Losh #define lua_number2strx(L,b,sz,f,n) \ 6208c784bb8SWarner Losh ((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n))) 6218c784bb8SWarner Losh #endif 6228c784bb8SWarner Losh 6238c784bb8SWarner Losh 6248c784bb8SWarner Losh /* 6258c784bb8SWarner Losh ** 'strtof' and 'opf' variants for math functions are not valid in 6268c784bb8SWarner Losh ** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the 6278c784bb8SWarner Losh ** availability of these variants. ('math.h' is already included in 6288c784bb8SWarner Losh ** all files that use these macros.) 6298c784bb8SWarner Losh */ 6308c784bb8SWarner Losh #if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF)) 6318c784bb8SWarner Losh #undef l_mathop /* variants not available */ 6328c784bb8SWarner Losh #undef lua_str2number 6338c784bb8SWarner Losh #define l_mathop(op) (lua_Number)op /* no variant */ 6348c784bb8SWarner Losh #define lua_str2number(s,p) ((lua_Number)strtod((s), (p))) 6358c784bb8SWarner Losh #endif 6368c784bb8SWarner Losh 6378c784bb8SWarner Losh 6388c784bb8SWarner Losh /* 6398c784bb8SWarner Losh @@ LUA_KCONTEXT is the type of the context ('ctx') for continuation 6408c784bb8SWarner Losh ** functions. It must be a numerical type; Lua will use 'intptr_t' if 6418c784bb8SWarner Losh ** available, otherwise it will use 'ptrdiff_t' (the nearest thing to 6428c784bb8SWarner Losh ** 'intptr_t' in C89) 6438c784bb8SWarner Losh */ 6448c784bb8SWarner Losh #define LUA_KCONTEXT ptrdiff_t 6458c784bb8SWarner Losh 6468c784bb8SWarner Losh #if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ 6478c784bb8SWarner Losh __STDC_VERSION__ >= 199901L 6488c784bb8SWarner Losh #include <stdint.h> 6498c784bb8SWarner Losh #if defined(INTPTR_MAX) /* even in C99 this type is optional */ 6508c784bb8SWarner Losh #undef LUA_KCONTEXT 6518c784bb8SWarner Losh #define LUA_KCONTEXT intptr_t 6528c784bb8SWarner Losh #endif 6538c784bb8SWarner Losh #endif 6548c784bb8SWarner Losh 6558c784bb8SWarner Losh 6568c784bb8SWarner Losh /* 6578c784bb8SWarner Losh @@ lua_getlocaledecpoint gets the locale "radix character" (decimal point). 6588c784bb8SWarner Losh ** Change that if you do not want to use C locales. (Code using this 6598c784bb8SWarner Losh ** macro must include the header 'locale.h'.) 6608c784bb8SWarner Losh */ 6618c784bb8SWarner Losh #if !defined(lua_getlocaledecpoint) 6628c784bb8SWarner Losh #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) 6638c784bb8SWarner Losh #endif 6648c784bb8SWarner Losh 6658c784bb8SWarner Losh 6668c784bb8SWarner Losh /* 6678c784bb8SWarner Losh ** macros to improve jump prediction, used mostly for error handling 6688c784bb8SWarner Losh ** and debug facilities. (Some macros in the Lua API use these macros. 6698c784bb8SWarner Losh ** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your 6708c784bb8SWarner Losh ** code.) 6718c784bb8SWarner Losh */ 6728c784bb8SWarner Losh #if !defined(luai_likely) 6738c784bb8SWarner Losh 6748c784bb8SWarner Losh #if defined(__GNUC__) && !defined(LUA_NOBUILTIN) 6758c784bb8SWarner Losh #define luai_likely(x) (__builtin_expect(((x) != 0), 1)) 6768c784bb8SWarner Losh #define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) 6778c784bb8SWarner Losh #else 6788c784bb8SWarner Losh #define luai_likely(x) (x) 6798c784bb8SWarner Losh #define luai_unlikely(x) (x) 6808c784bb8SWarner Losh #endif 6818c784bb8SWarner Losh 6828c784bb8SWarner Losh #endif 6838c784bb8SWarner Losh 6848c784bb8SWarner Losh 6858c784bb8SWarner Losh #if defined(LUA_CORE) || defined(LUA_LIB) 6868c784bb8SWarner Losh /* shorter names for Lua's own use */ 6878c784bb8SWarner Losh #define l_likely(x) luai_likely(x) 6888c784bb8SWarner Losh #define l_unlikely(x) luai_unlikely(x) 6898c784bb8SWarner Losh #endif 6908c784bb8SWarner Losh 6918c784bb8SWarner Losh 6928c784bb8SWarner Losh 6938c784bb8SWarner Losh /* }================================================================== */ 6948c784bb8SWarner Losh 6958c784bb8SWarner Losh 6968c784bb8SWarner Losh /* 6978c784bb8SWarner Losh ** {================================================================== 6988c784bb8SWarner Losh ** Language Variations 6998c784bb8SWarner Losh ** ===================================================================== 7008c784bb8SWarner Losh */ 7018c784bb8SWarner Losh 7028c784bb8SWarner Losh /* 7038c784bb8SWarner Losh @@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some 7048c784bb8SWarner Losh ** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from 7058c784bb8SWarner Losh ** numbers to strings. Define LUA_NOCVTS2N to turn off automatic 7068c784bb8SWarner Losh ** coercion from strings to numbers. 7078c784bb8SWarner Losh */ 7088c784bb8SWarner Losh /* #define LUA_NOCVTN2S */ 7098c784bb8SWarner Losh /* #define LUA_NOCVTS2N */ 7108c784bb8SWarner Losh 7118c784bb8SWarner Losh 7128c784bb8SWarner Losh /* 7138c784bb8SWarner Losh @@ LUA_USE_APICHECK turns on several consistency checks on the C API. 7148c784bb8SWarner Losh ** Define it as a help when debugging C code. 7158c784bb8SWarner Losh */ 7168c784bb8SWarner Losh #if defined(LUA_USE_APICHECK) 7178c784bb8SWarner Losh #include <assert.h> 7188c784bb8SWarner Losh #define luai_apicheck(l,e) assert(e) 7198c784bb8SWarner Losh #endif 7208c784bb8SWarner Losh 7218c784bb8SWarner Losh /* }================================================================== */ 7228c784bb8SWarner Losh 7238c784bb8SWarner Losh 7248c784bb8SWarner Losh /* 7258c784bb8SWarner Losh ** {================================================================== 7268c784bb8SWarner Losh ** Macros that affect the API and must be stable (that is, must be the 7278c784bb8SWarner Losh ** same when you compile Lua and when you compile code that links to 7288c784bb8SWarner Losh ** Lua). 7298c784bb8SWarner Losh ** ===================================================================== 7308c784bb8SWarner Losh */ 7318c784bb8SWarner Losh 7328c784bb8SWarner Losh /* 7338c784bb8SWarner Losh @@ LUAI_MAXSTACK limits the size of the Lua stack. 7348c784bb8SWarner Losh ** CHANGE it if you need a different limit. This limit is arbitrary; 7358c784bb8SWarner Losh ** its only purpose is to stop Lua from consuming unlimited stack 7368c784bb8SWarner Losh ** space (and to reserve some numbers for pseudo-indices). 737*a9490b81SWarner Losh ** (It must fit into max(size_t)/32 and max(int)/2.) 7388c784bb8SWarner Losh */ 7398c784bb8SWarner Losh #if LUAI_IS32INT 7408c784bb8SWarner Losh #define LUAI_MAXSTACK 1000000 7418c784bb8SWarner Losh #else 7428c784bb8SWarner Losh #define LUAI_MAXSTACK 15000 7438c784bb8SWarner Losh #endif 7448c784bb8SWarner Losh 7458c784bb8SWarner Losh 7468c784bb8SWarner Losh /* 7478c784bb8SWarner Losh @@ LUA_EXTRASPACE defines the size of a raw memory area associated with 7488c784bb8SWarner Losh ** a Lua state with very fast access. 7498c784bb8SWarner Losh ** CHANGE it if you need a different size. 7508c784bb8SWarner Losh */ 7518c784bb8SWarner Losh #define LUA_EXTRASPACE (sizeof(void *)) 7528c784bb8SWarner Losh 7538c784bb8SWarner Losh 7548c784bb8SWarner Losh /* 7558c784bb8SWarner Losh @@ LUA_IDSIZE gives the maximum size for the description of the source 756*a9490b81SWarner Losh ** of a function in debug information. 7578c784bb8SWarner Losh ** CHANGE it if you want a different size. 7588c784bb8SWarner Losh */ 7598c784bb8SWarner Losh #define LUA_IDSIZE 60 7608c784bb8SWarner Losh 7618c784bb8SWarner Losh 7628c784bb8SWarner Losh /* 763*a9490b81SWarner Losh @@ LUAL_BUFFERSIZE is the initial buffer size used by the lauxlib 764*a9490b81SWarner Losh ** buffer system. 7658c784bb8SWarner Losh */ 7668c784bb8SWarner Losh #define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) 7678c784bb8SWarner Losh 7688c784bb8SWarner Losh 7698c784bb8SWarner Losh /* 7708c784bb8SWarner Losh @@ LUAI_MAXALIGN defines fields that, when used in a union, ensure 7718c784bb8SWarner Losh ** maximum alignment for the other items in that union. 7728c784bb8SWarner Losh */ 7738c784bb8SWarner Losh #define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l 7748c784bb8SWarner Losh 7758c784bb8SWarner Losh /* }================================================================== */ 7768c784bb8SWarner Losh 7778c784bb8SWarner Losh 7788c784bb8SWarner Losh 7798c784bb8SWarner Losh 7808c784bb8SWarner Losh 7818c784bb8SWarner Losh /* =================================================================== */ 7828c784bb8SWarner Losh 7838c784bb8SWarner Losh /* 7848c784bb8SWarner Losh ** Local configuration. You can use this space to add your redefinitions 7858c784bb8SWarner Losh ** without modifying the main part of the file. 7868c784bb8SWarner Losh */ 7878c784bb8SWarner Losh 7888c784bb8SWarner Losh 7898c784bb8SWarner Losh 7908c784bb8SWarner Losh #include <luaconf.local.h> 7918c784bb8SWarner Losh 7928c784bb8SWarner Losh #endif 7938c784bb8SWarner Losh 794