Skip to content

Commit

Permalink
An easy way to tell if we are in debug mode (requires DEBUG macro to …
Browse files Browse the repository at this point in the history
…be defined)
  • Loading branch information
Corey Johnson committed Apr 1, 2011
1 parent 6165e40 commit bd975be
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/wax.m
Expand Up @@ -168,9 +168,10 @@ static void addGlobals(lua_State *L) {
lua_pushcfunction(L, waxPrint);
lua_setfield(L, -2, "print");


lua_pushcfunction(L, objcDebug);
lua_setfield(L, -2, "debug");
#ifdef DEBUG
lua_pushboolean(L, YES);
lua_setfield(L, -2, "isDebug");
#endif

lua_pop(L, 1); // pop the wax global off

Expand Down Expand Up @@ -244,9 +245,4 @@ static int toobjc(lua_State *L) {
static int exitApp(lua_State *L) {
exit(0);
return 0;
}

static int objcDebug(lua_State *L) {
NSLog(@"DEBUGGEG!");
return 0;
}

0 comments on commit bd975be

Please sign in to comment.