diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-06-18 09:51:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-06-18 09:51:05 -0300 |
commit | b43300c14f562bcdc1050f2c05e52fac3f6c99b7 (patch) | |
tree | b21fb2577e9f40340f22cbe44648a37f8d16f12f | |
parent | af70905246acfad225904b64d027e5b01c7b10eb (diff) | |
download | lua-b43300c14f562bcdc1050f2c05e52fac3f6c99b7.tar.gz lua-b43300c14f562bcdc1050f2c05e52fac3f6c99b7.tar.bz2 lua-b43300c14f562bcdc1050f2c05e52fac3f6c99b7.zip |
change in 'LUAI_DDEC' to allow variables to be static in 'onelua'
+ change in 'LUAMOD_API' as opening functions do not need to be global
-rw-r--r-- | lctype.h | 4 | ||||
-rw-r--r-- | lopcodes.h | 6 | ||||
-rw-r--r-- | ltm.h | 4 | ||||
-rw-r--r-- | luaconf.h | 16 |
4 files changed, 17 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lctype.h,v 1.11 2011/06/27 18:22:46 roberto Exp roberto $ | 2 | ** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp roberto $ |
3 | ** 'ctype' functions for Lua | 3 | ** 'ctype' functions for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -68,7 +68,7 @@ | |||
68 | 68 | ||
69 | 69 | ||
70 | /* two more entries for 0 and -1 (EOZ) */ | 70 | /* two more entries for 0 and -1 (EOZ) */ |
71 | LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2]; | 71 | LUAI_DDEC(const lu_byte luai_ctype_[UCHAR_MAX + 2];) |
72 | 72 | ||
73 | 73 | ||
74 | #else /* }{ */ | 74 | #else /* }{ */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.191 2018/04/04 14:23:41 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.192 2018/06/08 19:07:27 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -339,7 +339,7 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | |||
339 | ** bit 6: instruction sets 'L->top' for next instruction (when C == 0) | 339 | ** bit 6: instruction sets 'L->top' for next instruction (when C == 0) |
340 | */ | 340 | */ |
341 | 341 | ||
342 | LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; | 342 | LUAI_DDEC(const lu_byte luaP_opmodes[NUM_OPCODES];) |
343 | 343 | ||
344 | #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) | 344 | #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) |
345 | #define testAMode(m) (luaP_opmodes[m] & (1 << 3)) | 345 | #define testAMode(m) (luaP_opmodes[m] & (1 << 3)) |
@@ -358,7 +358,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; | |||
358 | #define opmode(ot,it,t,a,m) (((ot)<<6) | ((it)<<5) | ((t)<<4) | ((a)<<3) | (m)) | 358 | #define opmode(ot,it,t,a,m) (((ot)<<6) | ((it)<<5) | ((t)<<4) | ((a)<<3) | (m)) |
359 | 359 | ||
360 | 360 | ||
361 | LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ | 361 | LUAI_DDEC(const char *const luaP_opnames[NUM_OPCODES+1];) /* opcode names */ |
362 | 362 | ||
363 | 363 | ||
364 | /* number of list items to accumulate before a SETLIST instruction */ | 364 | /* number of list items to accumulate before a SETLIST instruction */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.h,v 2.37 2018/06/01 16:51:34 roberto Exp roberto $ | 2 | ** $Id: ltm.h,v 2.38 2018/06/08 19:06:59 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -58,7 +58,7 @@ typedef enum { | |||
58 | 58 | ||
59 | #define ttypename(x) luaT_typenames_[(x) + 1] | 59 | #define ttypename(x) luaT_typenames_[(x) + 1] |
60 | 60 | ||
61 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; | 61 | LUAI_DDEC(const char *const luaT_typenames_[LUA_TOTALTAGS];) |
62 | 62 | ||
63 | 63 | ||
64 | LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); | 64 | LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.268 2018/04/02 13:58:33 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.269 2018/06/15 15:49:28 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 | */ |
@@ -254,16 +254,20 @@ | |||
254 | #endif /* } */ | 254 | #endif /* } */ |
255 | 255 | ||
256 | 256 | ||
257 | /* more often than not the libs go together with the core */ | 257 | /* |
258 | ** More often than not the libs go together with the core; | ||
259 | ** Functions from the auxiliary library must be exported, | ||
260 | ** but opening functions do not. | ||
261 | */ | ||
258 | #define LUALIB_API LUA_API | 262 | #define LUALIB_API LUA_API |
259 | #define LUAMOD_API LUALIB_API | 263 | #define LUAMOD_API LUAI_FUNC |
260 | 264 | ||
261 | 265 | ||
262 | /* | 266 | /* |
263 | @@ LUAI_FUNC is a mark for all extern functions that are not to be | 267 | @@ LUAI_FUNC is a mark for all extern functions that are not to be |
264 | ** exported to outside modules. | 268 | ** exported to outside modules. |
265 | @@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables | 269 | @@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables, |
266 | ** that are not to be exported to outside modules (LUAI_DDEF for | 270 | ** none of which to be exported to outside modules (LUAI_DDEF for |
267 | ** definitions and LUAI_DDEC for declarations). | 271 | ** definitions and LUAI_DDEC for declarations). |
268 | ** CHANGE them if you need to mark them in some special way. Elf/gcc | 272 | ** CHANGE them if you need to mark them in some special way. Elf/gcc |
269 | ** (versions 3.2 and later) mark them as "hidden" to optimize access | 273 | ** (versions 3.2 and later) mark them as "hidden" to optimize access |
@@ -280,7 +284,7 @@ | |||
280 | #define LUAI_FUNC extern | 284 | #define LUAI_FUNC extern |
281 | #endif /* } */ | 285 | #endif /* } */ |
282 | 286 | ||
283 | #define LUAI_DDEC LUAI_FUNC | 287 | #define LUAI_DDEC(dec) LUAI_FUNC dec |
284 | #define LUAI_DDEF /* empty */ | 288 | #define LUAI_DDEF /* empty */ |
285 | 289 | ||
286 | /* }================================================================== */ | 290 | /* }================================================================== */ |