From 99391e24ea25641b0cf419334229452cef9e8581 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 20 May 2015 14:39:23 -0300 Subject: new configuration macro 'l_mathlim' (simplifies some dependencies on float type) --- luaconf.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index b5966a4d..5d8ce755 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.249 2015/03/31 12:00:07 roberto Exp roberto $ +** $Id: luaconf.h,v 1.250 2015/04/03 18:41:57 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -404,16 +404,14 @@ /* @@ LUA_NUMBER is the floating-point type used by Lua. -** @@ LUAI_UACNUMBER is the result of an 'usual argument conversion' @@ over a floating number. -** +@@ l_mathlim(x) corrects limit name 'x' to the proper float type +** by prefixing it with one of FLT/DBL/LDBL. @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. @@ LUA_NUMBER_FMT is the format for writing floats. @@ lua_number2str converts a float to a string. -** @@ l_mathop allows the addition of an 'l' or 'f' to all math operations. -** @@ lua_str2number converts a decimal numeric string to a number. */ @@ -421,6 +419,8 @@ #define LUA_NUMBER float +#define l_mathlim(n) (FLT_##n) + #define LUAI_UACNUMBER double #define LUA_NUMBER_FRMLEN "" @@ -435,6 +435,8 @@ #define LUA_NUMBER long double +#define l_mathlim(n) (LDBL_##n) + #define LUAI_UACNUMBER long double #define LUA_NUMBER_FRMLEN "L" @@ -448,6 +450,8 @@ #define LUA_NUMBER double +#define l_mathlim(n) (DBL_##n) + #define LUAI_UACNUMBER double #define LUA_NUMBER_FRMLEN "" @@ -620,7 +624,7 @@ #if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ __STDC_VERSION__ >= 199901L #include -#if defined (INTPTR_MAX) /* even in C99 this type is optional */ +#if defined(INTPTR_MAX) /* even in C99 this type is optional */ #undef LUA_KCONTEXT #define LUA_KCONTEXT intptr_t #endif -- cgit v1.2.3-55-g6feb