aboutsummaryrefslogtreecommitdiff
path: root/src/macros_and_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros_and_utils.h')
-rw-r--r--src/macros_and_utils.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h
index 9d73d50..550fc0a 100644
--- a/src/macros_and_utils.h
+++ b/src/macros_and_utils.h
@@ -36,8 +36,12 @@ extern char const* debugspew_indent;
36#define INDENT_BEGIN "%.*s " 36#define INDENT_BEGIN "%.*s "
37#define INDENT_END , (U ? U->debugspew_indent_depth : 0), debugspew_indent 37#define INDENT_END , (U ? U->debugspew_indent_depth : 0), debugspew_indent
38#define DEBUGSPEW_CODE(_code) _code 38#define DEBUGSPEW_CODE(_code) _code
39#define DEBUGSPEW_PARAM_COMMA( param_) param_,
40#define DEBUGSPEW_COMMA_PARAM( param_) , param_
39#else // USE_DEBUG_SPEW 41#else // USE_DEBUG_SPEW
40#define DEBUGSPEW_CODE(_code) 42#define DEBUGSPEW_CODE(_code)
43#define DEBUGSPEW_PARAM_COMMA( param_)
44#define DEBUGSPEW_COMMA_PARAM( param_)
41#endif // USE_DEBUG_SPEW 45#endif // USE_DEBUG_SPEW
42 46
43#ifdef NDEBUG 47#ifdef NDEBUG
@@ -56,10 +60,10 @@ extern char const* debugspew_indent;
56#define STACK_MID(L,change) \ 60#define STACK_MID(L,change) \
57 do \ 61 do \
58 { \ 62 { \
59 int a = lua_gettop( L) - _oldtop_##L; \ 63 int stack_check_a = lua_gettop( L) - _oldtop_##L; \
60 int b = (change); \ 64 int stack_check_b = (change); \
61 if( a != b) \ 65 if( stack_check_a != stack_check_b) \
62 luaL_error( L, "STACK ASSERT failed (%d not %d): %s:%d", a, b, __FILE__, __LINE__ ); \ 66 luaL_error( L, "STACK ASSERT failed (%d not %d): %s:%d", stack_check_a, stack_check_b, __FILE__, __LINE__ ); \
63 } while( 0) 67 } while( 0)
64#define STACK_END(L,change) STACK_MID(L,change); } 68#define STACK_END(L,change) STACK_MID(L,change); }
65 69