Browse Source

More methods switched to lowercase naming scheme.

legacy
Sam Hocevar 6 years ago
parent
commit
502e45d904
3 changed files with 19 additions and 9 deletions
  1. +6
    -1
      src/base/assert.cpp
  2. +12
    -7
      src/lol/base/assert.h
  3. +1
    -1
      src/lolua/baselua.cpp

+ 6
- 1
src/base/assert.cpp View File

@@ -26,7 +26,10 @@
namespace lol namespace lol
{ {


void DumpStack()
namespace debug
{

void dump_stack()
{ {
#if EMSCRIPTEN #if EMSCRIPTEN
/* This would require demangling but we don't care yet. */ /* This would require demangling but we don't care yet. */
@@ -83,5 +86,7 @@ void DumpStack()
#endif #endif
} }


} /* namespace debug */

} /* namespace lol */ } /* namespace lol */



+ 12
- 7
src/lol/base/assert.h View File

@@ -27,23 +27,28 @@
namespace lol namespace lol
{ {


static inline void Abort()
static inline void abort()
{ {
//*(uint32_t *)nullptr = 0xdead; //*(uint32_t *)nullptr = 0xdead;
std::abort(); std::abort();
} }


extern void DumpStack();

/* FIXME: see http://stackoverflow.com/q/3596781/111461 for discussions /* FIXME: see http://stackoverflow.com/q/3596781/111461 for discussions
* on implementing __debugbreak() on POSIX systems. */ * on implementing __debugbreak() on POSIX systems. */
static inline void DebugAbort()
namespace debug
{

extern void dump_stack();

static inline void abort()
{ {
lol::DumpStack();
dump_stack();
#if defined _WIN32 #if defined _WIN32
__debugbreak(); __debugbreak();
#endif #endif
lol::Abort();
lol::abort();
}

} }


#define LOL_CALL(macro, args) macro args #define LOL_CALL(macro, args) macro args
@@ -141,7 +146,7 @@ static inline void DebugAbort()
LOL_CALL(LOL_CAT(LOL_ERROR_, LOL_CALL(LOL_COUNT_TO_3, \ LOL_CALL(LOL_CAT(LOL_ERROR_, LOL_CALL(LOL_COUNT_TO_3, \
(__VA_ARGS__))), \ (__VA_ARGS__))), \
(__VA_ARGS__)); \ (__VA_ARGS__)); \
lol::DebugAbort(); \
lol::debug::abort(); \
} }
#endif #endif




+ 1
- 1
src/lolua/baselua.cpp View File

@@ -35,7 +35,7 @@ class LuaBaseData
{ {
char const *message = lua_tostring(l, -1); char const *message = lua_tostring(l, -1);
msg::error("%s\n", message); msg::error("%s\n", message);
DebugAbort();
debug::abort();
return 0; return 0;
} }




Loading…
Cancel
Save