Quellcode durchsuchen

'lua_assert' moved from 'lualib.h' to 'lauxlib.h'

The macro is useful also in 'lauxlib.c', which does not include
'lualib.h'. Also, the definition was corrected to be "on" when
LUAI_ASSERT is defined.
Roberto Ierusalimschy vor 4 Jahren
Ursprung
Commit
d41c36bf67
2 geänderte Dateien mit 12 neuen und 6 gelöschten Zeilen
  1. 12 0
      lauxlib.h
  2. 0 6
      lualib.h

+ 12 - 0
lauxlib.h

@@ -157,6 +157,18 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
 #define luaL_pushfail(L)	lua_pushnil(L)
 
 
+/*
+** Internal assertions for in-house debugging
+*/
+#if defined LUAI_ASSERT
+#include <assert.h>
+#define lua_assert(c)	assert(c)
+#else
+#define lua_assert(x)	((void)0)
+#endif
+
+
+
 /*
 ** {======================================================
 ** Generic Buffer manipulation

+ 0 - 6
lualib.h

@@ -49,10 +49,4 @@ LUAMOD_API int (luaopen_package) (lua_State *L);
 LUALIB_API void (luaL_openlibs) (lua_State *L);
 
 
-
-#if !defined(lua_assert)
-#define lua_assert(x)	((void)0)
-#endif
-
-
 #endif