diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-09 13:28:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-09 13:28:07 -0300 |
commit | 370d31a5593220723d222dec6e3e4019decc3309 (patch) | |
tree | e04ad903d079da2feea0b1759e89b65d1a70815c /luaconf.h | |
parent | f8df21bd2071c4e3729d37d1552f54ca2742551a (diff) | |
download | lua-370d31a5593220723d222dec6e3e4019decc3309.tar.gz lua-370d31a5593220723d222dec6e3e4019decc3309.tar.bz2 lua-370d31a5593220723d222dec6e3e4019decc3309.zip |
`luacĀ“ -> `luai' (to avoid confusion with other luac stuff)
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 106 |
1 files changed, 53 insertions, 53 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.33 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.34 2005/03/08 20:10:05 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 | */ |
@@ -152,16 +152,16 @@ | |||
152 | 152 | ||
153 | 153 | ||
154 | /* CONFIG: LUA-C API assertions */ | 154 | /* CONFIG: LUA-C API assertions */ |
155 | #define luac_apicheck(L,o) lua_assert(o) | 155 | #define luai_apicheck(L,o) lua_assert(o) |
156 | 156 | ||
157 | 157 | ||
158 | /* number of bits in an `int' */ | 158 | /* number of bits in an `int' */ |
159 | /* avoid overflows in comparison */ | 159 | /* avoid overflows in comparison */ |
160 | #if INT_MAX-20 < 32760 | 160 | #if INT_MAX-20 < 32760 |
161 | #define LUAC_BITSINT 16 | 161 | #define LUAI_BITSINT 16 |
162 | #elif INT_MAX > 2147483640L | 162 | #elif INT_MAX > 2147483640L |
163 | /* `int' has at least 32 bits */ | 163 | /* `int' has at least 32 bits */ |
164 | #define LUAC_BITSINT 32 | 164 | #define LUAI_BITSINT 32 |
165 | #else | 165 | #else |
166 | #error "you must define LUA_BITSINT with number of bits in an integer" | 166 | #error "you must define LUA_BITSINT with number of bits in an integer" |
167 | #endif | 167 | #endif |
@@ -169,59 +169,59 @@ | |||
169 | 169 | ||
170 | /* | 170 | /* |
171 | ** CONFIG: | 171 | ** CONFIG: |
172 | ** LUAC_UINT32: unsigned integer with at least 32 bits | 172 | ** LUAI_UINT32: unsigned integer with at least 32 bits |
173 | ** LUAC_INT32: signed integer with at least 32 bits | 173 | ** LUAI_INT32: signed integer with at least 32 bits |
174 | ** LUAC_UMEM: an unsigned integer big enough to count the total memory | 174 | ** LUAI_UMEM: an unsigned integer big enough to count the total memory |
175 | ** used by Lua | 175 | ** used by Lua |
176 | ** LUAC_MEM: a signed integer big enough to count the total memory used by Lua | 176 | ** LUAI_MEM: a signed integer big enough to count the total memory used by Lua |
177 | */ | 177 | */ |
178 | #if LUAC_BITSINT >= 32 | 178 | #if LUAI_BITSINT >= 32 |
179 | #define LUAC_UINT32 unsigned int | 179 | #define LUAI_UINT32 unsigned int |
180 | #define LUAC_INT32 int | 180 | #define LUAI_INT32 int |
181 | #define LUAC_MAXINT32 INT_MAX | 181 | #define LUAI_MAXINT32 INT_MAX |
182 | #define LUAC_UMEM size_t | 182 | #define LUAI_UMEM size_t |
183 | #define LUAC_MEM ptrdiff_t | 183 | #define LUAI_MEM ptrdiff_t |
184 | #else | 184 | #else |
185 | /* 16-bit ints */ | 185 | /* 16-bit ints */ |
186 | #define LUAC_UINT32 unsigned long | 186 | #define LUAI_UINT32 unsigned long |
187 | #define LUAC_INT32 long | 187 | #define LUAI_INT32 long |
188 | #define LUAC_MAXINT32 LONG_MAX | 188 | #define LUAI_MAXINT32 LONG_MAX |
189 | #define LUAC_UMEM LUAC_UINT32 | 189 | #define LUAI_UMEM LUAI_UINT32 |
190 | #define LUAC_MEM ptrdiff_t | 190 | #define LUAI_MEM ptrdiff_t |
191 | #endif | 191 | #endif |
192 | 192 | ||
193 | 193 | ||
194 | /* CONFIG: maximum depth for calls (unsigned short) */ | 194 | /* CONFIG: maximum depth for calls (unsigned short) */ |
195 | #define LUAC_MAXCALLS 10000 | 195 | #define LUAI_MAXCALLS 10000 |
196 | 196 | ||
197 | /* | 197 | /* |
198 | ** CONFIG: maximum depth for C calls (unsigned short): Not too big, or may | 198 | ** CONFIG: maximum depth for C calls (unsigned short): Not too big, or may |
199 | ** overflow the C stack... | 199 | ** overflow the C stack... |
200 | */ | 200 | */ |
201 | #define LUAC_MAXCCALLS 200 | 201 | #define LUAI_MAXCCALLS 200 |
202 | 202 | ||
203 | 203 | ||
204 | /* CONFIG: maximum size for the virtual stack of a C function */ | 204 | /* CONFIG: maximum size for the virtual stack of a C function */ |
205 | #define LUAC_MAXCSTACK 2048 | 205 | #define LUAI_MAXCSTACK 2048 |
206 | 206 | ||
207 | 207 | ||
208 | /* | 208 | /* |
209 | ** CONFIG: maximum number of syntactical nested non-terminals: Not too big, | 209 | ** CONFIG: maximum number of syntactical nested non-terminals: Not too big, |
210 | ** or may overflow the C stack... | 210 | ** or may overflow the C stack... |
211 | */ | 211 | */ |
212 | #define LUAC_MAXPARSERLEVEL 200 | 212 | #define LUAI_MAXPARSERLEVEL 200 |
213 | 213 | ||
214 | 214 | ||
215 | /* CONFIG: maximum number of variables declared in a function */ | 215 | /* CONFIG: maximum number of variables declared in a function */ |
216 | #define LUAC_MAXVARS 200 /* <MAXSTACK */ | 216 | #define LUAI_MAXVARS 200 /* <MAXSTACK */ |
217 | 217 | ||
218 | 218 | ||
219 | /* CONFIG: maximum number of upvalues per function */ | 219 | /* CONFIG: maximum number of upvalues per function */ |
220 | #define LUAC_MAXUPVALUES 60 /* <MAXSTACK */ | 220 | #define LUAI_MAXUPVALUES 60 /* <MAXSTACK */ |
221 | 221 | ||
222 | 222 | ||
223 | /* CONFIG: maximum size of expressions for optimizing `while' code */ | 223 | /* CONFIG: maximum size of expressions for optimizing `while' code */ |
224 | #define LUAC_MAXEXPWHILE 100 | 224 | #define LUAI_MAXEXPWHILE 100 |
225 | 225 | ||
226 | 226 | ||
227 | /* CONFIG: function to convert a lua_Number to int (with any rounding method) */ | 227 | /* CONFIG: function to convert a lua_Number to int (with any rounding method) */ |
@@ -257,7 +257,7 @@ __inline int l_lrint (double flt) | |||
257 | /* CONFIG: function to convert a lua_Number to a string */ | 257 | /* CONFIG: function to convert a lua_Number to a string */ |
258 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) | 258 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) |
259 | /* maximum size of previous conversion */ | 259 | /* maximum size of previous conversion */ |
260 | #define LUAC_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ | 260 | #define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ |
261 | 261 | ||
262 | /* CONFIG: function to convert a string to a lua_Number */ | 262 | /* CONFIG: function to convert a string to a lua_Number */ |
263 | #define lua_str2number(s,p) strtod((s), (p)) | 263 | #define lua_str2number(s,p) strtod((s), (p)) |
@@ -265,25 +265,25 @@ __inline int l_lrint (double flt) | |||
265 | 265 | ||
266 | 266 | ||
267 | /* CONFIG: result of a `usual argument conversion' over lua_Number */ | 267 | /* CONFIG: result of a `usual argument conversion' over lua_Number */ |
268 | #define LUAC_UACNUMBER double | 268 | #define LUAI_UACNUMBER double |
269 | 269 | ||
270 | 270 | ||
271 | /* CONFIG: primitive operators for numbers */ | 271 | /* CONFIG: primitive operators for numbers */ |
272 | #define luac_numadd(a,b) ((a)+(b)) | 272 | #define luai_numadd(a,b) ((a)+(b)) |
273 | #define luac_numsub(a,b) ((a)-(b)) | 273 | #define luai_numsub(a,b) ((a)-(b)) |
274 | #define luac_nummul(a,b) ((a)*(b)) | 274 | #define luai_nummul(a,b) ((a)*(b)) |
275 | #define luac_numdiv(a,b) ((a)/(b)) | 275 | #define luai_numdiv(a,b) ((a)/(b)) |
276 | #define luac_numunm(a) (-(a)) | 276 | #define luai_numunm(a) (-(a)) |
277 | #define luac_numeq(a,b) ((a)==(b)) | 277 | #define luai_numeq(a,b) ((a)==(b)) |
278 | #define luac_numlt(a,b) ((a)<(b)) | 278 | #define luai_numlt(a,b) ((a)<(b)) |
279 | #define luac_numle(a,b) ((a)<=(b)) | 279 | #define luai_numle(a,b) ((a)<=(b)) |
280 | #define luac_nummod(a,b) ((a) - floor((a)/(b))*(b)) | 280 | #define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) |
281 | #define luac_numpow(a,b) pow(a,b) | 281 | #define luai_numpow(a,b) pow(a,b) |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | /* CONFIG: type to ensure maximum alignment */ | 285 | /* CONFIG: type to ensure maximum alignment */ |
286 | #define LUAC_USER_ALIGNMENT_T union { double u; void *s; long l; } | 286 | #define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } |
287 | 287 | ||
288 | 288 | ||
289 | /* | 289 | /* |
@@ -294,16 +294,16 @@ __inline int l_lrint (double flt) | |||
294 | */ | 294 | */ |
295 | #ifndef __cplusplus | 295 | #ifndef __cplusplus |
296 | /* default handling with long jumps */ | 296 | /* default handling with long jumps */ |
297 | #define LUAC_THROW(L,c) longjmp((c)->b, 1) | 297 | #define LUAI_THROW(L,c) longjmp((c)->b, 1) |
298 | #define LUAC_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } | 298 | #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } |
299 | #define luac_jmpbuf jmp_buf | 299 | #define luai_jmpbuf jmp_buf |
300 | 300 | ||
301 | #else | 301 | #else |
302 | /* C++ exceptions */ | 302 | /* C++ exceptions */ |
303 | #define LUAC_THROW(L,c) throw(c) | 303 | #define LUAI_THROW(L,c) throw(c) |
304 | #define LUAC_TRY(L,c,a) try { a } catch(...) \ | 304 | #define LUAI_TRY(L,c,a) try { a } catch(...) \ |
305 | { if ((c)->status == 0) (c)->status = -1; } | 305 | { if ((c)->status == 0) (c)->status = -1; } |
306 | #define luac_jmpbuf int /* dummy variable */ | 306 | #define luai_jmpbuf int /* dummy variable */ |
307 | #endif | 307 | #endif |
308 | 308 | ||
309 | 309 | ||
@@ -349,9 +349,9 @@ __inline int l_lrint (double flt) | |||
349 | ** want (or do not want) `os.tmpname' available. | 349 | ** want (or do not want) `os.tmpname' available. |
350 | */ | 350 | */ |
351 | #ifdef __GNUC__ | 351 | #ifdef __GNUC__ |
352 | #define LUA_USETMPNAME 0 | 352 | #define LUA_USE_TMPNAME 0 |
353 | #else | 353 | #else |
354 | #define LUA_USETMPNAME 1 | 354 | #define LUA_USE_TMPNAME 1 |
355 | #endif | 355 | #endif |
356 | 356 | ||
357 | 357 | ||
@@ -359,15 +359,15 @@ __inline int l_lrint (double flt) | |||
359 | ** CONFIG: Configuration for loadlib: Lua tries to guess the | 359 | ** CONFIG: Configuration for loadlib: Lua tries to guess the |
360 | ** dynamic-library system that your platform uses (either Windows' DLL, | 360 | ** dynamic-library system that your platform uses (either Windows' DLL, |
361 | ** Mac's dyld, or dlopen). If your system is some kind of Unix, there is | 361 | ** Mac's dyld, or dlopen). If your system is some kind of Unix, there is |
362 | ** a good chance that LUA_USEDLOPEN will work for it. You may need to adapt | 362 | ** a good chance that LUA_USE_DLOPEN will work for it. You may need to adapt |
363 | ** also the makefile. | 363 | ** also the makefile. |
364 | */ | 364 | */ |
365 | #if defined(_WIN32) | 365 | #if defined(_WIN32) |
366 | #define LUA_USEDLL | 366 | #define LUA_USE_DLL |
367 | #elif defined(__APPLE__) && defined(__MACH__) | 367 | #elif defined(__APPLE__) && defined(__MACH__) |
368 | #define LUA_USEDYLD | 368 | #define LUA_USE_DYLD |
369 | #elif defined(__linux) || defined(sun) || defined(sgi) || defined(BSD) | 369 | #elif defined(__linux) || defined(sun) || defined(sgi) || defined(BSD) |
370 | #define LUA_USEDLOPEN | 370 | #define LUA_USE_DLOPEN |
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | 373 | ||
@@ -376,7 +376,7 @@ __inline int l_lrint (double flt) | |||
376 | 376 | ||
377 | /* Local configuration */ | 377 | /* Local configuration */ |
378 | 378 | ||
379 | #undef LUA_USETMPNAME | 379 | #undef LUA_USE_TMPNAME |
380 | #define LUA_USETMPNAME 1 | 380 | #define LUA_USE_TMPNAME 1 |
381 | 381 | ||
382 | #endif | 382 | #endif |