summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lctype.c4
-rw-r--r--lctype.h4
-rw-r--r--lobject.c4
-rw-r--r--lobject.h4
-rw-r--r--lopcodes.c6
-rw-r--r--lopcodes.h6
-rw-r--r--ltests.h6
-rw-r--r--ltm.c4
-rw-r--r--ltm.h4
-rw-r--r--luaconf.h16
10 files changed, 31 insertions, 27 deletions
diff --git a/lctype.c b/lctype.c
index ec3dd265..b8570a19 100644
--- a/lctype.c
+++ b/lctype.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lctype.c,v 1.6 2009/05/18 17:15:14 roberto Exp roberto $ 2** $Id: lctype.c,v 1.7 2009/05/27 16:51:15 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*/
@@ -8,7 +8,7 @@
8 8
9#include "lctype.h" 9#include "lctype.h"
10 10
11const lu_byte luai_ctype_[UCHAR_MAX + 2] = { 11LUAI_DDEF const lu_byte luai_ctype_[UCHAR_MAX + 2] = {
12 0x00, /* EOZ */ 12 0x00, /* EOZ */
13 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 14 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
diff --git a/lctype.h b/lctype.h
index 0b96bff4..7abf6e58 100644
--- a/lctype.h
+++ b/lctype.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lctype.h,v 1.6 2009/05/18 17:15:14 roberto Exp roberto $ 2** $Id: lctype.h,v 1.7 2009/05/27 16:51:15 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*/
@@ -44,7 +44,7 @@
44 44
45 45
46/* one more entry for 0 and one more for -1 (EOZ) */ 46/* one more entry for 0 and one more for -1 (EOZ) */
47LUAI_DATA const lu_byte luai_ctype_[UCHAR_MAX + 2]; 47LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2];
48 48
49#endif 49#endif
50 50
diff --git a/lobject.c b/lobject.c
index 846d02a7..346db7be 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.31 2009/06/17 17:48:34 roberto Exp roberto $ 2** $Id: lobject.c,v 2.32 2009/11/06 17:07:12 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,7 +25,7 @@
25 25
26 26
27 27
28const TValue luaO_nilobject_ = {NILCONSTANT}; 28LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT};
29 29
30 30
31/* 31/*
diff --git a/lobject.h b/lobject.h
index fe198355..5dcfb3d3 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.31 2009/11/05 17:43:54 roberto Exp roberto $ 2** $Id: lobject.h,v 2.32 2009/11/06 17:09:27 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -370,7 +370,7 @@ typedef struct Table {
370 370
371#define luaO_nilobject (&luaO_nilobject_) 371#define luaO_nilobject (&luaO_nilobject_)
372 372
373LUAI_DATA const TValue luaO_nilobject_; 373LUAI_DDEC const TValue luaO_nilobject_;
374 374
375LUAI_FUNC int luaO_int2fb (unsigned int x); 375LUAI_FUNC int luaO_int2fb (unsigned int x);
376LUAI_FUNC int luaO_fb2int (int x); 376LUAI_FUNC int luaO_fb2int (int x);
diff --git a/lopcodes.c b/lopcodes.c
index d8bf6316..4bcd2b6e 100644
--- a/lopcodes.c
+++ b/lopcodes.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.c,v 1.39 2008/04/02 16:16:06 roberto Exp roberto $ 2** $Id: lopcodes.c,v 1.40 2008/10/30 15:39:30 roberto Exp roberto $
3** See Copyright Notice in lua.h 3** See Copyright Notice in lua.h
4*/ 4*/
5 5
@@ -13,7 +13,7 @@
13 13
14/* ORDER OP */ 14/* ORDER OP */
15 15
16const char *const luaP_opnames[NUM_OPCODES+1] = { 16LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
17 "MOVE", 17 "MOVE",
18 "LOADK", 18 "LOADK",
19 "LOADBOOL", 19 "LOADBOOL",
@@ -60,7 +60,7 @@ const char *const luaP_opnames[NUM_OPCODES+1] = {
60 60
61#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) 61#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
62 62
63const lu_byte luaP_opmodes[NUM_OPCODES] = { 63LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
64/* T A B C mode opcode */ 64/* T A B C mode opcode */
65 opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ 65 opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
66 ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ 66 ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
diff --git a/lopcodes.h b/lopcodes.h
index 77da09aa..bd8cc082 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.131 2009/09/28 16:32:50 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.132 2009/10/28 12:20:07 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*/
@@ -270,7 +270,7 @@ enum OpArgMask {
270 OpArgK /* argument is a constant or register/constant */ 270 OpArgK /* argument is a constant or register/constant */
271}; 271};
272 272
273LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES]; 273LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES];
274 274
275#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) 275#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
276#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) 276#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
@@ -279,7 +279,7 @@ LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
279#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) 279#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
280 280
281 281
282LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ 282LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
283 283
284 284
285/* number of list items to accumulate before a SETLIST instruction */ 285/* number of list items to accumulate before a SETLIST instruction */
diff --git a/ltests.h b/ltests.h
index 4a27d099..f2abb234 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 2.24 2008/08/05 19:24:46 roberto Exp roberto $ 2** $Id: ltests.h,v 2.25 2009/04/17 22:00:01 roberto Exp roberto $
3** Internal Header for Debugging of the Lua Implementation 3** Internal Header for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -32,13 +32,13 @@ typedef struct Memcontrol {
32 unsigned long memlimit; 32 unsigned long memlimit;
33} Memcontrol; 33} Memcontrol;
34 34
35LUAI_DATA Memcontrol l_memcontrol; 35Memcontrol l_memcontrol;
36 36
37 37
38/* 38/*
39** generic variable for debug tricks 39** generic variable for debug tricks
40*/ 40*/
41LUAI_DATA void *l_Trick; 41void *l_Trick;
42 42
43 43
44void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize); 44void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize);
diff --git a/ltm.c b/ltm.c
index 5ab2e8b4..3495658a 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 2.8 2006/01/10 12:50:00 roberto Exp roberto $ 2** $Id: ltm.c,v 2.9 2007/09/10 17:59:32 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*/
@@ -20,7 +20,7 @@
20 20
21 21
22 22
23const char *const luaT_typenames[] = { 23LUAI_DDEF const char *const luaT_typenames[] = {
24 "nil", "boolean", "userdata", "number", 24 "nil", "boolean", "userdata", "number",
25 "string", "table", "function", "userdata", "thread", 25 "string", "table", "function", "userdata", "thread",
26 "proto", "upval" 26 "proto", "upval"
diff --git a/ltm.h b/ltm.h
index 7f1c1e5d..64e867b8 100644
--- a/ltm.h
+++ b/ltm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.h,v 2.6 2005/06/06 13:30:25 roberto Exp roberto $ 2** $Id: ltm.h,v 2.7 2007/09/10 17:59:32 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*/
@@ -43,7 +43,7 @@ typedef enum {
43 43
44#define fasttm(l,et,e) gfasttm(G(l), et, e) 44#define fasttm(l,et,e) gfasttm(G(l), et, e)
45 45
46LUAI_DATA const char *const luaT_typenames[]; 46LUAI_DDEC const char *const luaT_typenames[];
47 47
48 48
49LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 49LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
diff --git a/luaconf.h b/luaconf.h
index 8939dd27..d3454d3b 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.113 2009/11/16 15:51:03 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.114 2009/11/19 16:26:52 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*/
@@ -170,8 +170,9 @@
170/* 170/*
171@@ LUAI_FUNC is a mark for all extern functions that are not to be 171@@ LUAI_FUNC is a mark for all extern functions that are not to be
172@* exported to outside modules. 172@* exported to outside modules.
173@@ LUAI_DATA is a mark for all extern (const) variables that are not to 173@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
174@* be exported to outside modules. 174@* that are not to be exported to outside modules (LUAI_DDEF for
175@* definitions and LUAI_DDEC for declarations).
175** CHANGE them if you need to mark them in some special way. Elf/gcc 176** CHANGE them if you need to mark them in some special way. Elf/gcc
176** (versions 3.2 and later) mark them as "hidden" to optimize access 177** (versions 3.2 and later) mark them as "hidden" to optimize access
177** when Lua is compiled as a shared library. Not all elf targets support 178** when Lua is compiled as a shared library. Not all elf targets support
@@ -182,16 +183,19 @@
182*/ 183*/
183#if defined(luaall_c) 184#if defined(luaall_c)
184#define LUAI_FUNC static 185#define LUAI_FUNC static
185#define LUAI_DATA extern 186#define LUAI_DDEC static
187#define LUAI_DDEF static
186 188
187#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ 189#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
188 defined(__ELF__) 190 defined(__ELF__)
189#define LUAI_FUNC __attribute__((visibility("hidden"))) extern 191#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
190#define LUAI_DATA LUAI_FUNC 192#define LUAI_DDEC LUAI_FUNC
193#define LUAI_DDEF /* empty */
191 194
192#else 195#else
193#define LUAI_FUNC extern 196#define LUAI_FUNC extern
194#define LUAI_DATA extern 197#define LUAI_DDEC extern
198#define LUAI_DDEF /* empty */
195#endif 199#endif
196 200
197 201