From 8efcd411fee4e7103cff7b027fca38290cdaa6f7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Feb 2015 10:52:57 -0200 Subject: own implementation for 'string.format("%a")' for C89 platforms --- luaconf.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index b6508d70..25571bd7 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.241 2015/01/16 17:15:52 roberto Exp roberto $ +** $Id: luaconf.h,v 1.242 2015/01/16 17:26:56 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -598,7 +598,7 @@ /* @@ lua_strx2number converts an hexadecimal numeric string to a number. -** In C99, 'strtod' does both conversions. Otherwise, you can +** In C99, 'strtod' does that conversion. Otherwise, you can ** leave 'lua_strx2number' undefined and Lua will provide its own ** implementation. */ @@ -608,12 +608,13 @@ /* -@@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format' -** Enable it if the C function 'printf' supports these specifiers. -** (C99 demands it and Windows also supports it.) +@@ lua_number2strx converts a float to an hexadecimal numeric string. +** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. +** Otherwise, you can leave 'lua_number2strx' undefined and Lua will +** provide its own implementation. */ -#if !defined(LUA_USE_C89) || defined(LUA_USE_WINDOWS) -#define LUA_USE_AFORMAT +#if !defined(LUA_USE_C89) +#define lua_number2strx(L,b,f,n) sprintf(b,f,n) #endif @@ -699,7 +700,6 @@ #define LUAL_BUFFERSIZE 8192 #else #define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) - #endif /* }================================================================== */ -- cgit v1.2.3-55-g6feb