diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-31 09:00:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-31 09:00:07 -0300 |
commit | cfc84c856d2441829c4b6c4b1766a01d4a462973 (patch) | |
tree | 4e0463cccff4a02de13a56d44db1b412e0964684 /luaconf.h | |
parent | 63720a4290e1ed3042e3b356af56374ecb635a20 (diff) | |
download | lua-cfc84c856d2441829c4b6c4b1766a01d4a462973.tar.gz lua-cfc84c856d2441829c4b6c4b1766a01d4a462973.tar.bz2 lua-cfc84c856d2441829c4b6c4b1766a01d4a462973.zip |
'LUA_REAL_*' -> 'LUA_FLOAT_*' (everywhere else we are using 'float')
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.247 2015/03/02 16:59:01 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.248 2015/03/06 19:49:50 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 | */ |
@@ -97,7 +97,7 @@ | |||
97 | 97 | ||
98 | /* | 98 | /* |
99 | @@ LUA_INT_TYPE defines the type for Lua integers. | 99 | @@ LUA_INT_TYPE defines the type for Lua integers. |
100 | @@ LUA_REAL_TYPE defines the type for Lua floats. | 100 | @@ LUA_FLOAT_TYPE defines the type for Lua floats. |
101 | ** Lua should work fine with any mix of these options (if supported | 101 | ** Lua should work fine with any mix of these options (if supported |
102 | ** by your C compiler). The usual configurations are 64-bit integers | 102 | ** by your C compiler). The usual configurations are 64-bit integers |
103 | ** and 'double' (the default), 32-bit integers and 'float' (for | 103 | ** and 'double' (the default), 32-bit integers and 'float' (for |
@@ -110,10 +110,10 @@ | |||
110 | #define LUA_INT_LONG 2 | 110 | #define LUA_INT_LONG 2 |
111 | #define LUA_INT_LONGLONG 3 | 111 | #define LUA_INT_LONGLONG 3 |
112 | 112 | ||
113 | /* predefined options for LUA_REAL_TYPE */ | 113 | /* predefined options for LUA_FLOAT_TYPE */ |
114 | #define LUA_REAL_FLOAT 1 | 114 | #define LUA_FLOAT_FLOAT 1 |
115 | #define LUA_REAL_DOUBLE 2 | 115 | #define LUA_FLOAT_DOUBLE 2 |
116 | #define LUA_REAL_LONGDOUBLE 3 | 116 | #define LUA_FLOAT_LONGDOUBLE 3 |
117 | 117 | ||
118 | #if defined(LUA_32BITS) /* { */ | 118 | #if defined(LUA_32BITS) /* { */ |
119 | /* | 119 | /* |
@@ -124,22 +124,27 @@ | |||
124 | #else /* otherwise use 'long' */ | 124 | #else /* otherwise use 'long' */ |
125 | #define LUA_INT_TYPE LUA_INT_LONG | 125 | #define LUA_INT_TYPE LUA_INT_LONG |
126 | #endif | 126 | #endif |
127 | #define LUA_REAL_TYPE LUA_REAL_FLOAT | 127 | #define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT |
128 | 128 | ||
129 | #elif defined(LUA_C89_NUMBERS) /* }{ */ | 129 | #elif defined(LUA_C89_NUMBERS) /* }{ */ |
130 | /* | 130 | /* |
131 | ** largest types available for C89 ('long' and 'double') | 131 | ** largest types available for C89 ('long' and 'double') |
132 | */ | 132 | */ |
133 | #define LUA_INT_TYPE LUA_INT_LONG | 133 | #define LUA_INT_TYPE LUA_INT_LONG |
134 | #define LUA_REAL_TYPE LUA_REAL_DOUBLE | 134 | #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE |
135 | |||
136 | #endif /* } */ | ||
137 | |||
135 | 138 | ||
136 | #else /* }{ */ | ||
137 | /* | 139 | /* |
138 | ** default configuration for 64-bit Lua ('long long' and 'double') | 140 | ** default configuration for 64-bit Lua ('long long' and 'double') |
139 | */ | 141 | */ |
142 | #if !defined(LUA_INT_TYPE) | ||
140 | #define LUA_INT_TYPE LUA_INT_LONGLONG | 143 | #define LUA_INT_TYPE LUA_INT_LONGLONG |
141 | #define LUA_REAL_TYPE LUA_REAL_DOUBLE | 144 | #endif |
142 | 145 | ||
146 | #if !defined(LUA_FLOAT_TYPE) | ||
147 | #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE | ||
143 | #endif /* } */ | 148 | #endif /* } */ |
144 | 149 | ||
145 | /* }================================================================== */ | 150 | /* }================================================================== */ |
@@ -392,7 +397,7 @@ | |||
392 | /* | 397 | /* |
393 | ** {================================================================== | 398 | ** {================================================================== |
394 | ** Configuration for Numbers. | 399 | ** Configuration for Numbers. |
395 | ** Change these definitions if no predefined LUA_REAL_* / LUA_INT_* | 400 | ** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* |
396 | ** satisfy your needs. | 401 | ** satisfy your needs. |
397 | ** =================================================================== | 402 | ** =================================================================== |
398 | */ | 403 | */ |
@@ -412,7 +417,7 @@ | |||
412 | @@ lua_str2number converts a decimal numeric string to a number. | 417 | @@ lua_str2number converts a decimal numeric string to a number. |
413 | */ | 418 | */ |
414 | 419 | ||
415 | #if LUA_REAL_TYPE == LUA_REAL_FLOAT /* { single float */ | 420 | #if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */ |
416 | 421 | ||
417 | #define LUA_NUMBER float | 422 | #define LUA_NUMBER float |
418 | 423 | ||
@@ -426,7 +431,7 @@ | |||
426 | #define lua_str2number(s,p) strtof((s), (p)) | 431 | #define lua_str2number(s,p) strtof((s), (p)) |
427 | 432 | ||
428 | 433 | ||
429 | #elif LUA_REAL_TYPE == LUA_REAL_LONGDOUBLE /* }{ long double */ | 434 | #elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ |
430 | 435 | ||
431 | #define LUA_NUMBER long double | 436 | #define LUA_NUMBER long double |
432 | 437 | ||
@@ -439,7 +444,7 @@ | |||
439 | 444 | ||
440 | #define lua_str2number(s,p) strtold((s), (p)) | 445 | #define lua_str2number(s,p) strtold((s), (p)) |
441 | 446 | ||
442 | #elif LUA_REAL_TYPE == LUA_REAL_DOUBLE /* }{ double */ | 447 | #elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */ |
443 | 448 | ||
444 | #define LUA_NUMBER double | 449 | #define LUA_NUMBER double |
445 | 450 | ||
@@ -454,7 +459,7 @@ | |||
454 | 459 | ||
455 | #else /* }{ */ | 460 | #else /* }{ */ |
456 | 461 | ||
457 | #error "numeric real type not defined" | 462 | #error "numeric float type not defined" |
458 | 463 | ||
459 | #endif /* } */ | 464 | #endif /* } */ |
460 | 465 | ||
@@ -696,7 +701,7 @@ | |||
696 | ** smaller buffer would force a memory allocation for each call to | 701 | ** smaller buffer would force a memory allocation for each call to |
697 | ** 'string.format'.) | 702 | ** 'string.format'.) |
698 | */ | 703 | */ |
699 | #if defined(LUA_REAL_LONGDOUBLE) | 704 | #if defined(LUA_FLOAT_LONGDOUBLE) |
700 | #define LUAL_BUFFERSIZE 8192 | 705 | #define LUAL_BUFFERSIZE 8192 |
701 | #else | 706 | #else |
702 | #define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) | 707 | #define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) |