Browse Source

more options moved from luaconf.h into internal files

Roberto Ierusalimschy 15 years ago
parent
commit
46f1429936
3 changed files with 53 additions and 36 deletions
  1. 33 1
      llimits.h
  2. 19 1
      lstrlib.c
  3. 1 34
      luaconf.h

+ 33 - 1
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
 */

+ 19 - 1
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 */

+ 1 - 34
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
-
 
 
 /* =================================================================== */