aboutsummaryrefslogtreecommitdiff
path: root/c-api
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2015-01-13 17:54:32 +0100
committerPhilipp Janda <siffiejoe@gmx.net>2015-01-13 17:54:32 +0100
commitcc7b56b179cf84364a270463a59aa7d6f74dd35b (patch)
treea1de23a09aefde76084ffa47d61a51bcf593d6ba /c-api
parent305e7f071a48695e82430a948e931a8419998c4d (diff)
downloadlua-compat-5.3-cc7b56b179cf84364a270463a59aa7d6f74dd35b.tar.gz
lua-compat-5.3-cc7b56b179cf84364a270463a59aa7d6f74dd35b.tar.bz2
lua-compat-5.3-cc7b56b179cf84364a270463a59aa7d6f74dd35b.zip
add fallback for lua_str2number, readme fix
Diffstat (limited to 'c-api')
-rw-r--r--c-api/compat-5.3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c
index 9edd5f1..ecb22b0 100644
--- a/c-api/compat-5.3.c
+++ b/c-api/compat-5.3.c
@@ -362,6 +362,10 @@ COMPAT53_API void lua_seti (lua_State *L, int index, lua_Integer i) {
362} 362}
363 363
364 364
365#if !defined(lua_str2number)
366# define lua_str2number(s, p) strtod(s, p)
367#endif
368
365COMPAT53_API size_t lua_stringtonumber (lua_State *L, const char *s) { 369COMPAT53_API size_t lua_stringtonumber (lua_State *L, const char *s) {
366 char* endptr; 370 char* endptr;
367 lua_Number n = lua_str2number(s, &endptr); 371 lua_Number n = lua_str2number(s, &endptr);