diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-12-16 15:17:30 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-12-16 15:17:30 -0200 |
| commit | 6d79752e654aade3a0dcbed007fb05d73583f7df (patch) | |
| tree | bf5c8757029620859fd7c9dbf2fca4e42268508e | |
| parent | 75812a517bf03a6b213bcfc0c14989b45230f344 (diff) | |
| download | lua-6d79752e654aade3a0dcbed007fb05d73583f7df.tar.gz lua-6d79752e654aade3a0dcbed007fb05d73583f7df.tar.bz2 lua-6d79752e654aade3a0dcbed007fb05d73583f7df.zip | |
Windows uses 'long long' (instead of '__int64') when present; again,
uses macro LLONG_MAX as a proxy for the support for 'long long'.
| -rw-r--r-- | luaconf.h | 30 |
1 files changed, 15 insertions, 15 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.233 2014/12/13 17:57:00 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.234 2014/12/16 16:20:01 roberto Exp roberto $ |
| 3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -55,7 +55,6 @@ | |||
| 55 | #if defined(LUA_USE_WINDOWS) | 55 | #if defined(LUA_USE_WINDOWS) |
| 56 | #define LUA_DL_DLL /* enable support for DLL */ | 56 | #define LUA_DL_DLL /* enable support for DLL */ |
| 57 | #define LUA_USE_C89 /* broadly, Windows is C89 */ | 57 | #define LUA_USE_C89 /* broadly, Windows is C89 */ |
| 58 | #define LUA_USE_I64 /* use Windows-specifc type for 64-bit integers */ | ||
| 59 | #endif | 58 | #endif |
| 60 | 59 | ||
| 61 | 60 | ||
| @@ -75,8 +74,8 @@ | |||
| 75 | 74 | ||
| 76 | /* | 75 | /* |
| 77 | @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for | 76 | @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for |
| 78 | ** C89 ('long' and 'double'); Windows has '__int64', so it does not need | 77 | ** C89 ('long' and 'double'); Windows always has '__int64', so it does |
| 79 | ** to use this case. | 78 | ** not need to use this case. |
| 80 | */ | 79 | */ |
| 81 | #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) | 80 | #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) |
| 82 | #define LUA_C89_NUMBERS | 81 | #define LUA_C89_NUMBERS |
| @@ -128,8 +127,7 @@ | |||
| 128 | 127 | ||
| 129 | #else /* }{ */ | 128 | #else /* }{ */ |
| 130 | /* | 129 | /* |
| 131 | ** default configuration for 64-bit Lua ('long long' and 'double'); | 130 | ** default configuration for 64-bit Lua ('long long' and 'double') |
| 132 | ** Windows will use '__int64' | ||
| 133 | */ | 131 | */ |
| 134 | #define LUA_INT_LONGLONG | 132 | #define LUA_INT_LONGLONG |
| 135 | #define LUA_REAL_DOUBLE | 133 | #define LUA_REAL_DOUBLE |
| @@ -566,7 +564,17 @@ | |||
| 566 | 564 | ||
| 567 | #elif defined(LUA_INT_LONGLONG) /* }{ long long */ | 565 | #elif defined(LUA_INT_LONGLONG) /* }{ long long */ |
| 568 | 566 | ||
| 569 | #if defined(LUA_USE_I64) /* { */ | 567 | #if defined(LLONG_MAX) /* { */ |
| 568 | /* use ISO C99 stuff */ | ||
| 569 | |||
| 570 | #define LUA_INTEGER long long | ||
| 571 | #define LUA_INTEGER_FRMLEN "ll" | ||
| 572 | |||
| 573 | #define LUA_MAXINTEGER LLONG_MAX | ||
| 574 | #define LUA_MININTEGER LLONG_MIN | ||
| 575 | |||
| 576 | #elif defined(LUA_USE_WINDOWS) /* }{ */ | ||
| 577 | /* in Windows, can use specific Windows types */ | ||
| 570 | 578 | ||
| 571 | #define LUA_INTEGER __int64 | 579 | #define LUA_INTEGER __int64 |
| 572 | #define LUA_INTEGER_FRMLEN "I64" | 580 | #define LUA_INTEGER_FRMLEN "I64" |
| @@ -576,16 +584,8 @@ | |||
| 576 | 584 | ||
| 577 | #else /* }{ */ | 585 | #else /* }{ */ |
| 578 | 586 | ||
| 579 | #if !defined(LLONG_MAX) | ||
| 580 | #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ | 587 | #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ |
| 581 | or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" | 588 | or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" |
| 582 | #endif | ||
| 583 | |||
| 584 | #define LUA_INTEGER long long | ||
| 585 | #define LUA_INTEGER_FRMLEN "ll" | ||
| 586 | |||
| 587 | #define LUA_MAXINTEGER LLONG_MAX | ||
| 588 | #define LUA_MININTEGER LLONG_MIN | ||
| 589 | 589 | ||
| 590 | #endif /* } */ | 590 | #endif /* } */ |
| 591 | 591 | ||
