diff options
Diffstat (limited to 'libs/liblua/src/luaconf.h')
-rw-r--r-- | libs/liblua/src/luaconf.h | 111 |
1 files changed, 41 insertions, 70 deletions
diff --git a/libs/liblua/src/luaconf.h b/libs/liblua/src/luaconf.h index e64d2ee392..d9cf18ca1d 100644 --- a/libs/liblua/src/luaconf.h +++ b/libs/liblua/src/luaconf.h @@ -16,13 +16,13 @@ ** =================================================================== ** General Configuration File for Lua ** -** Some definitions here can be changed externally, through the compiler -** (e.g., with '-D' options): They are commented out or protected -** by '#if !defined' guards. However, several other definitions -** should be changed directly here, either because they affect the -** Lua ABI (by making the changes here, you ensure that all software -** connected to Lua, such as C libraries, will be compiled with the same -** configuration); or because they are seldom changed. +** Some definitions here can be changed externally, through the +** compiler (e.g., with '-D' options). Those are protected by +** '#if !defined' guards. However, several other definitions should +** be changed directly here, either because they affect the Lua +** ABI (by making the changes here, you ensure that all software +** connected to Lua, such as C libraries, will be compiled with the +** same configuration); or because they are seldom changed. ** ** Search for "@@" to find all configurable definitions. ** =================================================================== @@ -81,13 +81,27 @@ /* ** {================================================================== -** Configuration for Number types. These options should not be -** set externally, because any other code connected to Lua must -** use the same configuration. +** Configuration for Number types. ** =================================================================== */ /* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. +*/ +/* #define LUA_32BITS */ + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS +#endif + + +/* @@ LUA_INT_TYPE defines the type for Lua integers. @@ LUA_FLOAT_TYPE defines the type for Lua floats. ** Lua should work fine with any mix of these options supported @@ -107,31 +121,7 @@ #define LUA_FLOAT_DOUBLE 2 #define LUA_FLOAT_LONGDOUBLE 3 - -/* Default configuration ('long long' and 'double', for 64-bit Lua) */ -#define LUA_INT_DEFAULT LUA_INT_LONGLONG -#define LUA_FLOAT_DEFAULT LUA_FLOAT_DOUBLE - - -/* -@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. -*/ -#define LUA_32BITS 0 - - -/* -@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for -** C89 ('long' and 'double'); Windows always has '__int64', so it does -** not need to use this case. -*/ -#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) -#define LUA_C89_NUMBERS 1 -#else -#define LUA_C89_NUMBERS 0 -#endif - - -#if LUA_32BITS /* { */ +#if defined(LUA_32BITS) /* { */ /* ** 32-bit integers and 'float' */ @@ -142,21 +132,26 @@ #endif #define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT -#elif LUA_C89_NUMBERS /* }{ */ +#elif defined(LUA_C89_NUMBERS) /* }{ */ /* ** largest types available for C89 ('long' and 'double') */ #define LUA_INT_TYPE LUA_INT_LONG #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE -#else /* }{ */ -/* use defaults */ +#endif /* } */ -#define LUA_INT_TYPE LUA_INT_DEFAULT -#define LUA_FLOAT_TYPE LUA_FLOAT_DEFAULT -#endif /* } */ +/* +** default configuration for 64-bit Lua ('long long' and 'double') +*/ +#if !defined(LUA_INT_TYPE) +#define LUA_INT_TYPE LUA_INT_LONGLONG +#endif +#if !defined(LUA_FLOAT_TYPE) +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE +#endif /* }================================================================== */ @@ -378,13 +373,14 @@ /* ** {================================================================== -** Configuration for Numbers (low-level part). +** Configuration for Numbers. ** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* ** satisfy your needs. ** =================================================================== */ /* +@@ LUA_NUMBER is the floating-point type used by Lua. @@ LUAI_UACNUMBER is the result of a 'default argument promotion' @@ over a floating number. @@ l_floatatt(x) corrects float attribute 'x' to the proper float type @@ -477,7 +473,10 @@ /* +@@ LUA_INTEGER is the integer type used by Lua. +** @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. +** @@ LUAI_UACINT is the result of a 'default argument promotion' @@ over a LUA_INTEGER. @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. @@ -660,34 +659,6 @@ #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) #endif - -/* -** macros to improve jump prediction, used mostly for error handling -** and debug facilities. (Some macros in the Lua API use these macros. -** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your -** code.) -*/ -#if !defined(luai_likely) - -#if defined(__GNUC__) && !defined(LUA_NOBUILTIN) -#define luai_likely(x) (__builtin_expect(((x) != 0), 1)) -#define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) -#else -#define luai_likely(x) (x) -#define luai_unlikely(x) (x) -#endif - -#endif - - -#if defined(LUA_CORE) || defined(LUA_LIB) -/* shorter names for Lua's own use */ -#define l_likely(x) luai_likely(x) -#define l_unlikely(x) luai_unlikely(x) -#endif - - - /* }================================================================== */ |