diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-06-01 14:07:45 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-06-01 14:07:45 -0300 |
| commit | e33d7bae45f5b29f83f893ba16a7f78d28b77245 (patch) | |
| tree | 5d858632a930f8aedce37a5fcc3c00d674b762d8 | |
| parent | d628795940cb00420829077869c0efe5678b4e18 (diff) | |
| download | lua-e33d7bae45f5b29f83f893ba16a7f78d28b77245.tar.gz lua-e33d7bae45f5b29f83f893ba16a7f78d28b77245.tar.bz2 lua-e33d7bae45f5b29f83f893ba16a7f78d28b77245.zip | |
__STRICT_ANSI__ -> LUA_ANSI (definition is independent of gcc)
| -rw-r--r-- | luaconf.h | 34 |
1 files changed, 21 insertions, 13 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.50 2005/05/20 15:53:42 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.51 2005/05/20 19:09:05 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 | */ |
| @@ -22,6 +22,16 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | /* | 24 | /* |
| 25 | @@ LUA_ANSI controls the use of non-ansi features. | ||
| 26 | ** CHANGE it (define it) if you want Lua to avoid the use of any | ||
| 27 | ** non-ansi feature or library. | ||
| 28 | */ | ||
| 29 | #if defined(__STRICT_ANSI__) | ||
| 30 | #define LUA_ANSI | ||
| 31 | #endif | ||
| 32 | |||
| 33 | |||
| 34 | /* | ||
| 25 | @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for | 35 | @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for |
| 26 | @* Lua libraries. | 36 | @* Lua libraries. |
| 27 | @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for | 37 | @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for |
| @@ -168,10 +178,10 @@ | |||
| 168 | ** CHANGE it if you have a better definition for non-POSIX/non-Windows | 178 | ** CHANGE it if you have a better definition for non-POSIX/non-Windows |
| 169 | ** systems. | 179 | ** systems. |
| 170 | */ | 180 | */ |
| 171 | #if !defined(__STRICT_ANSI__) && defined(_POSIX_C_SOURCE) | 181 | #if !defined(LUA_ANSI) && defined(_POSIX_C_SOURCE) |
| 172 | #include <unistd.h> | 182 | #include <unistd.h> |
| 173 | #define lua_stdin_is_tty() isatty(0) | 183 | #define lua_stdin_is_tty() isatty(0) |
| 174 | #elif !defined(__STRICT_ANSI__) && defined(_WIN32) | 184 | #elif !defined(LUA_ANSI) && defined(_WIN32) |
| 175 | #include <io.h> | 185 | #include <io.h> |
| 176 | #include <stdio.h> | 186 | #include <stdio.h> |
| 177 | #define lua_stdin_is_tty() _isatty(_fileno(stdin)) | 187 | #define lua_stdin_is_tty() _isatty(_fileno(stdin)) |
| @@ -214,7 +224,7 @@ | |||
| 214 | ** CHANGE them if you want to improve this functionality (e.g., by using | 224 | ** CHANGE them if you want to improve this functionality (e.g., by using |
| 215 | ** GNU readline and history facilities). | 225 | ** GNU readline and history facilities). |
| 216 | */ | 226 | */ |
| 217 | #if !defined(__STRICT_ANSI__) && defined(LUA_USE_READLINE) | 227 | #if !defined(LUA_ANSI) && defined(LUA_USE_READLINE) |
| 218 | #include <stdio.h> | 228 | #include <stdio.h> |
| 219 | #include <readline/readline.h> | 229 | #include <readline/readline.h> |
| 220 | #include <readline/history.h> | 230 | #include <readline/history.h> |
| @@ -431,14 +441,12 @@ | |||
| 431 | */ | 441 | */ |
| 432 | 442 | ||
| 433 | /* On a gcc/Pentium, resort to assembler */ | 443 | /* On a gcc/Pentium, resort to assembler */ |
| 434 | #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__i386) | 444 | #if !defined(LUA_ANSI) && defined(__GNUC__) && defined(__i386) |
| 435 | #define lua_number2int(i,d) __asm__ ("fistpl %0":"=m"(i):"t"(d):"st") | 445 | #define lua_number2int(i,d) __asm__ ("fistpl %0":"=m"(i):"t"(d):"st") |
| 436 | 446 | ||
| 437 | /* On Windows/Pentium, resort to assembler */ | 447 | /* On Windows/Pentium, resort to assembler */ |
| 438 | #elif !defined(__STRICT_ANSI__) && defined(_MSC_VER) && defined(_M_IX86) | 448 | #elif !defined(LUA_ANSI) && defined(_MSC_VER) && defined(_M_IX86) |
| 439 | #define lua_number2int(i,d) \ | 449 | #define lua_number2int(i,d) __asm fld d __asm fistp i |
| 440 | __asm fld d \ | ||
| 441 | __asm fistp i | ||
| 442 | 450 | ||
| 443 | 451 | ||
| 444 | /* on Pentium machines compliant with C99, you can try lrint */ | 452 | /* on Pentium machines compliant with C99, you can try lrint */ |
| @@ -485,7 +493,7 @@ | |||
| 485 | @* over a number. | 493 | @* over a number. |
| 486 | */ | 494 | */ |
| 487 | #define LUA_NUMBER double | 495 | #define LUA_NUMBER double |
| 488 | #define LUAI_UACNUMBER LUA_NUMBER | 496 | #define LUAI_UACNUMBER double |
| 489 | 497 | ||
| 490 | 498 | ||
| 491 | /* | 499 | /* |
| @@ -544,7 +552,7 @@ | |||
| 544 | { if ((c)->status == 0) (c)->status = -1; } | 552 | { if ((c)->status == 0) (c)->status = -1; } |
| 545 | #define luai_jmpbuf int /* dummy variable */ | 553 | #define luai_jmpbuf int /* dummy variable */ |
| 546 | 554 | ||
| 547 | #elif !defined(__STRICT_ANSI__) && (defined(unix) || defined(__unix) || \ | 555 | #elif !defined(LUA_ANSI) && (defined(unix) || defined(__unix) || \ |
| 548 | defined(__unix__)) | 556 | defined(__unix__)) |
| 549 | /* in Unix, try _longjmp/_setjmp (more efficient) */ | 557 | /* in Unix, try _longjmp/_setjmp (more efficient) */ |
| 550 | #define LUAI_THROW(L,c) _longjmp((c)->b, 1) | 558 | #define LUAI_THROW(L,c) _longjmp((c)->b, 1) |
| @@ -578,7 +586,7 @@ | |||
| 578 | */ | 586 | */ |
| 579 | #if defined(loslib_c) || defined(luaall_c) | 587 | #if defined(loslib_c) || defined(luaall_c) |
| 580 | 588 | ||
| 581 | #if !defined(__STRICT_ANSI__) && defined(_POSIX_C_SOURCE) | 589 | #if !defined(LUA_ANSI) && defined(_POSIX_C_SOURCE) |
| 582 | #include <unistd.h> | 590 | #include <unistd.h> |
| 583 | #define LUA_TMPNAMBUFSIZE 32 | 591 | #define LUA_TMPNAMBUFSIZE 32 |
| 584 | #define lua_tmpnam(b,e) { \ | 592 | #define lua_tmpnam(b,e) { \ |
| @@ -606,7 +614,7 @@ | |||
| 606 | ** If you do not want any kind of dynamic library, undefine all these | 614 | ** If you do not want any kind of dynamic library, undefine all these |
| 607 | ** options (or just remove these definitions). | 615 | ** options (or just remove these definitions). |
| 608 | */ | 616 | */ |
| 609 | #if !defined(__STRICT_ANSI__) | 617 | #if !defined(LUA_ANSI) |
| 610 | #if defined(_WIN32) | 618 | #if defined(_WIN32) |
| 611 | #define LUA_DL_DLL | 619 | #define LUA_DL_DLL |
| 612 | #elif defined(__APPLE__) && defined(__MACH__) | 620 | #elif defined(__APPLE__) && defined(__MACH__) |
