From 46f1429936ff7cde274f9896d022ab494567ee7a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Dec 2009 10:50:20 -0200 Subject: more options moved from luaconf.h into internal files --- llimits.h | 34 +++++++++++++++++++++++++++++++++- lstrlib.c | 20 +++++++++++++++++++- luaconf.h | 35 +---------------------------------- 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/llimits.h b/llimits.h index c613605d..c6b5b479 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.75 2009/11/17 11:56:03 roberto Exp roberto $ +** $Id: llimits.h,v 1.76 2009/12/17 12:26:09 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -133,6 +133,38 @@ typedef lu_int32 Instruction; #endif +/* +** these macros allow user-specific actions on threads when you defined +** LUAI_EXTRASPACE and need to do something extra when a thread is +** created/deleted/resumed/yielded. +*/ +#if !defined(luai_userstateopen) +#define luai_userstateopen(L) ((void)L) +#endif + +#if !defined(luai_userstateclose) +#define luai_userstateclose(L) ((void)L) +#endif + +#if !defined(luai_userstatethread) +#define luai_userstatethread(L,L1) ((void)L) +#endif + +#if !defined(luai_userstatefree) +#define luai_userstatefree(L) ((void)L) +#endif + +#if !defined(luai_userstateresume) +#define luai_userstateresume(L,n) ((void)L) +#endif + +#if !defined(luai_userstateyield) +#define luai_userstateyield(L,n) ((void)L) +#endif + + + + /* ** macro to control inclusion of some hard tests on stack reallocation */ diff --git a/lstrlib.c b/lstrlib.c index 09382c6b..c34a82ef 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.145 2009/11/26 16:49:28 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.146 2009/12/17 12:26:09 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -698,6 +698,24 @@ static int str_gsub (lua_State *L) { /* }====================================================== */ +/* +** length modifier for integer conversions ** in 'string.format' and +** integer type corresponding to the previous length +*/ + +#if defined(LUA_USELONGLONG) + +#define LUA_INTFRMLEN "ll" +#define LUA_INTFRM_T long long + +#else + +#define LUA_INTFRMLEN "l" +#define LUA_INTFRM_T long + +#endif + + /* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ #define MAX_ITEM 512 /* valid flags in a format specification */ diff --git a/luaconf.h b/luaconf.h index cc788af2..070a25d5 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.121 2009/12/14 15:27:30 roberto Exp roberto $ +** $Id: luaconf.h,v 1.122 2009/12/17 12:26:09 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -524,39 +524,6 @@ union luai_Cast { double l_d; long l_l; }; #endif -/* -@@ luai_userstate* allow user-specific actions on threads. -** CHANGE them if you defined LUAI_EXTRASPACE and need to do something -** extra when a thread is created/deleted/resumed/yielded. -*/ -#define luai_userstateopen(L) ((void)L) -#define luai_userstateclose(L) ((void)L) -#define luai_userstatethread(L,L1) ((void)L) -#define luai_userstatefree(L) ((void)L) -#define luai_userstateresume(L,n) ((void)L) -#define luai_userstateyield(L,n) ((void)L) - - -/* -@@ LUA_INTFRMLEN is the length modifier for integer conversions -@* in 'string.format'. -@@ LUA_INTFRM_T is the integer type corresponding to the previous length -@* modifier. -** CHANGE them if your system supports long long or does not support long. -*/ - -#if defined(LUA_USELONGLONG) - -#define LUA_INTFRMLEN "ll" -#define LUA_INTFRM_T long long - -#else - -#define LUA_INTFRMLEN "l" -#define LUA_INTFRM_T long - -#endif - /* =================================================================== */ -- cgit v1.2.3-55-g6feb