Browse Source

simpler configuration to turn on all asserts

Roberto Ierusalimschy 21 years ago
parent
commit
226c57fec0
3 changed files with 6 additions and 11 deletions
  1. 2 4
      llimits.h
  2. 1 4
      ltests.h
  3. 3 3
      luaconf.h

+ 2 - 4
llimits.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: llimits.h,v 1.58 2004/04/30 20:13:38 roberto Exp roberto $
+** $Id: llimits.h,v 1.59 2004/06/23 15:57:29 roberto Exp roberto $
 ** Limits, basic types, and some other `installation-dependent' definitions
 ** Limits, basic types, and some other `installation-dependent' definitions
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -63,9 +63,7 @@ typedef LUSER_ALIGNMENT_T L_Umaxalign;
 typedef LUA_UACNUMBER l_uacNumber;
 typedef LUA_UACNUMBER l_uacNumber;
 
 
 
 
-#ifndef check_exp
-#define check_exp(c,e)	(e)
-#endif
+#define check_exp(c,e)	(lua_assert(c), (e))
 
 
 
 
 #ifndef UNUSED
 #ifndef UNUSED

+ 1 - 4
ltests.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltests.h,v 2.8 2004/07/09 14:29:29 roberto Exp roberto $
+** $Id: ltests.h,v 2.9 2004/07/16 13:17:00 roberto Exp roberto $
 ** Internal Header for Debugging of the Lua Implementation
 ** Internal Header for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -17,9 +17,6 @@
 #include <assert.h>
 #include <assert.h>
 #undef lua_assert
 #undef lua_assert
 #define lua_assert(c)           assert(c)
 #define lua_assert(c)           assert(c)
-#define check_exp(c,e)		(lua_assert(c), (e))
-#undef api_check
-#define api_check(L, o)		lua_assert(o)
 
 
 
 
 /* to avoid warnings, and to make sure value is really unused */
 /* to avoid warnings, and to make sure value is really unused */

+ 3 - 3
luaconf.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: luaconf.h,v 1.10 2004/08/30 13:44:04 roberto Exp roberto $
+** $Id: luaconf.h,v 1.11 2004/08/30 18:35:14 roberto Exp roberto $
 ** Configuration file for Lua
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -60,7 +60,7 @@
 #define LUA_FIRSTINDEX		1
 #define LUA_FIRSTINDEX		1
 
 
 /* assertions in Lua (mainly for internal debugging) */
 /* assertions in Lua (mainly for internal debugging) */
-#define lua_assert(c)		/* empty */
+#define lua_assert(c)		((void)0)
 
 
 /* }====================================================== */
 /* }====================================================== */
 
 
@@ -123,7 +123,7 @@
 #ifdef LUA_CORE
 #ifdef LUA_CORE
 
 
 /* LUA-C API assertions */
 /* LUA-C API assertions */
-#define api_check(L, o)		/* empty */
+#define api_check(L, o)		lua_assert(o)
 
 
 
 
 /* an unsigned integer with at least 32 bits */
 /* an unsigned integer with at least 32 bits */