Przeglądaj źródła

Detail

Added macro LUA_FAILISFALSE to make easier to change the fail value
from nil to false.
Roberto Ierusalimschy 5 miesięcy temu
rodzic
commit
cb88c1cd5d
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      lauxlib.h

+ 4 - 0
lauxlib.h

@@ -165,7 +165,11 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
 
 
 /* push the value used to represent failure/error */
+#if defined(LUA_FAILISFALSE)
+#define luaL_pushfail(L)	lua_pushboolean(L, 0)
+#else
 #define luaL_pushfail(L)	lua_pushnil(L)
+#endif