diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-19 17:06:52 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-19 17:06:52 -0200 |
| commit | 062e809e542ec066986c4e3e054f95e1bfc0cb50 (patch) | |
| tree | 5663d1961cb5253f4261dc3df7d3ac3c9a18f6a1 /luaconf.h | |
| parent | b4c18248247d84a3acffc020b09d1637dd2990c6 (diff) | |
| download | lua-062e809e542ec066986c4e3e054f95e1bfc0cb50.tar.gz lua-062e809e542ec066986c4e3e054f95e1bfc0cb50.tar.bz2 lua-062e809e542ec066986c4e3e054f95e1bfc0cb50.zip | |
new macros 'LUAI_DDEC'/'LUAI_DDEF' to better control declarations and
definitions of non-static variables
Diffstat (limited to 'luaconf.h')
| -rw-r--r-- | luaconf.h | 16 |
1 files changed, 10 insertions, 6 deletions
| @@ -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 | ||
