diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-26 10:35:52 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-26 10:35:52 -0300 |
| commit | 3563b3f51942da0cc0360394476b3910b51ebdd9 (patch) | |
| tree | d0373fd2011f5e632da7cba66c79c90536440cbc | |
| parent | d46ed54646b2953007a882f3d4c743741914e202 (diff) | |
| download | lua-3563b3f51942da0cc0360394476b3910b51ebdd9.tar.gz lua-3563b3f51942da0cc0360394476b3910b51ebdd9.tar.bz2 lua-3563b3f51942da0cc0360394476b3910b51ebdd9.zip | |
first version of control for number sizes (still in 'local' section)
| -rw-r--r-- | luaconf.h | 40 |
1 files changed, 36 insertions, 4 deletions
| @@ -410,7 +410,7 @@ | |||
| 410 | /* | 410 | /* |
| 411 | @@ l_mathop allows the addition of an 'l' or 'f' to all math operations | 411 | @@ l_mathop allows the addition of an 'l' or 'f' to all math operations |
| 412 | */ | 412 | */ |
| 413 | #define l_mathop(x) (x) | 413 | #define l_mathop(x) x |
| 414 | 414 | ||
| 415 | 415 | ||
| 416 | /* | 416 | /* |
| @@ -464,21 +464,22 @@ | |||
| 464 | /* | 464 | /* |
| 465 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. | 465 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. |
| 466 | */ | 466 | */ |
| 467 | #define LUA_UNSIGNED unsigned long long | 467 | #define LUA_UNSIGNED unsigned LUA_INTEGER |
| 468 | 468 | ||
| 469 | /* | 469 | /* |
| 470 | @@ LUA_INTEGER_FRMLEN is the length modifier for writing integers. | 470 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. |
| 471 | @@ LUA_INTEGER_SCAN is the format for reading integers. | 471 | @@ LUA_INTEGER_SCAN is the format for reading integers. |
| 472 | @@ LUA_INTEGER_FMT is the format for writing integers. | 472 | @@ LUA_INTEGER_FMT is the format for writing integers. |
| 473 | @@ lua_integer2str converts an integer to a string. | 473 | @@ lua_integer2str converts an integer to a string. |
| 474 | @@ LUAI_MAXINTEGER2STR is maximum size of previous conversion. | 474 | @@ LUAI_MAXINTEGER2STR is maximum size of previous conversion. |
| 475 | */ | 475 | */ |
| 476 | #define LUA_INTEGER_FRMLEN "ll" | 476 | #define LUA_INTEGER_FRMLEN "ll" |
| 477 | #define LUA_INTEGER_SCAN "%Ld" | 477 | #define LUA_INTEGER_SCAN "%" LUA_INTEGER_FRMLEN "d" |
| 478 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" | 478 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" |
| 479 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) | 479 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) |
| 480 | #define LUA_MAXINTEGER2STR 32 | 480 | #define LUA_MAXINTEGER2STR 32 |
| 481 | 481 | ||
| 482 | |||
| 482 | /* }================================================================== */ | 483 | /* }================================================================== */ |
| 483 | 484 | ||
| 484 | 485 | ||
| @@ -491,7 +492,38 @@ | |||
| 491 | ** without modifying the main part of the file. | 492 | ** without modifying the main part of the file. |
| 492 | */ | 493 | */ |
| 493 | 494 | ||
| 495 | #define LUA_SMALL_INT | ||
| 496 | #define LUA_SMALL_FLOAT | ||
| 497 | |||
| 498 | |||
| 499 | #if defined(LUA_SMALL_FLOAT) /* { */ | ||
| 500 | |||
| 501 | #undef LUA_NUMBER_DOUBLE | ||
| 502 | |||
| 503 | #undef LUA_NUMBER | ||
| 504 | #define LUA_NUMBER float | ||
| 505 | |||
| 506 | #undef LUA_NUMBER_SCAN | ||
| 507 | #define LUA_NUMBER_SCAN "%f" | ||
| 508 | |||
| 509 | #undef LUA_NUMBER_FMT | ||
| 510 | #define LUA_NUMBER_FMT "%.7g" | ||
| 511 | |||
| 512 | #undef l_mathop | ||
| 513 | #define l_mathop(x) x##f | ||
| 514 | |||
| 515 | #endif /* } */ | ||
| 516 | |||
| 517 | |||
| 518 | #if defined (LUA_SMALL_INT) /* { */ | ||
| 519 | |||
| 520 | #undef LUA_INTEGER | ||
| 521 | #define LUA_INTEGER long | ||
| 522 | |||
| 523 | #undef LUA_INTEGER_FRMLEN | ||
| 524 | #define LUA_INTEGER_FRMLEN "l" | ||
| 494 | 525 | ||
| 526 | #endif /* } */ | ||
| 495 | 527 | ||
| 496 | #endif | 528 | #endif |
| 497 | 529 | ||
