shithub: lu9-lua

Download patch

ref: 1661838889c6586f04d8add58654df1f5a85eb99
parent: a1ccc9baa07a2c23123b27e0eb8733b42126d4b3
author: kvik <[email protected]>
date: Mon Feb 8 19:15:28 EST 2021

luaconf: enable Lua's own string<->number functions

The Plan 9 versions of these either don't exist or aren't fully
compatible with their ANSI counterparts.

--- a/luaconf.h
+++ b/luaconf.h
@@ -593,7 +593,7 @@
 ** leave 'lua_strx2number' undefined and Lua will provide its own
 ** implementation.
 */
-#if !defined(LUA_USE_C89)
+#if !defined(LUA_USE_C89) && !defined(LUA_USE_PLAN9)
 #define lua_strx2number(s,p)		lua_str2number(s,p)
 #endif
 
@@ -611,7 +611,7 @@
 ** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
 ** provide its own implementation.
 */
-#if !defined(LUA_USE_C89)
+#if !defined(LUA_USE_C89) && !defined(LUA_USE_PLAN9)
 #define lua_number2strx(L,b,sz,f,n)  \
 	((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n)))
 #endif
@@ -623,7 +623,7 @@
 ** availability of these variants. ('math.h' is already included in
 ** all files that use these macros.)
 */
-#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
+#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF)) || defined(LUA_USE_PLAN9)
 #undef l_mathop  /* variants not available */
 #undef lua_str2number
 #define l_mathop(op)		(lua_Number)op  /* no variant */