diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-04 10:52:57 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-04 10:52:57 -0200 |
commit | 8efcd411fee4e7103cff7b027fca38290cdaa6f7 (patch) | |
tree | 3d65016ec6316bed51653e128d540168019a54d7 /luaconf.h | |
parent | 90d016980f47fb4f760be2356e715f92af9a7af8 (diff) | |
download | lua-8efcd411fee4e7103cff7b027fca38290cdaa6f7.tar.gz lua-8efcd411fee4e7103cff7b027fca38290cdaa6f7.tar.bz2 lua-8efcd411fee4e7103cff7b027fca38290cdaa6f7.zip |
own implementation for 'string.format("%a")' for C89 platforms
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.241 2015/01/16 17:15:52 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.242 2015/01/16 17:26:56 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 | */ |
@@ -598,7 +598,7 @@ | |||
598 | 598 | ||
599 | /* | 599 | /* |
600 | @@ lua_strx2number converts an hexadecimal numeric string to a number. | 600 | @@ lua_strx2number converts an hexadecimal numeric string to a number. |
601 | ** In C99, 'strtod' does both conversions. Otherwise, you can | 601 | ** In C99, 'strtod' does that conversion. Otherwise, you can |
602 | ** leave 'lua_strx2number' undefined and Lua will provide its own | 602 | ** leave 'lua_strx2number' undefined and Lua will provide its own |
603 | ** implementation. | 603 | ** implementation. |
604 | */ | 604 | */ |
@@ -608,12 +608,13 @@ | |||
608 | 608 | ||
609 | 609 | ||
610 | /* | 610 | /* |
611 | @@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format' | 611 | @@ lua_number2strx converts a float to an hexadecimal numeric string. |
612 | ** Enable it if the C function 'printf' supports these specifiers. | 612 | ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. |
613 | ** (C99 demands it and Windows also supports it.) | 613 | ** Otherwise, you can leave 'lua_number2strx' undefined and Lua will |
614 | ** provide its own implementation. | ||
614 | */ | 615 | */ |
615 | #if !defined(LUA_USE_C89) || defined(LUA_USE_WINDOWS) | 616 | #if !defined(LUA_USE_C89) |
616 | #define LUA_USE_AFORMAT | 617 | #define lua_number2strx(L,b,f,n) sprintf(b,f,n) |
617 | #endif | 618 | #endif |
618 | 619 | ||
619 | 620 | ||
@@ -699,7 +700,6 @@ | |||
699 | #define LUAL_BUFFERSIZE 8192 | 700 | #define LUAL_BUFFERSIZE 8192 |
700 | #else | 701 | #else |
701 | #define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) | 702 | #define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) |
702 | |||
703 | #endif | 703 | #endif |
704 | 704 | ||
705 | /* }================================================================== */ | 705 | /* }================================================================== */ |