void MainLayer::quit()
{
-#if NDEBUG
- // we don't really need to unwind the stack and shut everything down because
- // the operating system will take care of cleaning up
- exit(0);
-#else
+ // remove all the layers
mEngine->clear();
-#endif
}
* @param X test to perform
*/
-#if ! NDEBUG
+#undef ASSERT
+
+#if NDEBUG
+#define ASSERT(X)
+#else
#define ASSERT(X) if (!(X)) Mf::logError("false assertion at %s:%d, " #X, \
__FILE__, __LINE__), exit(1)
-#else
-#define ASSERT(X)
#endif
#include <ctime>
#include <limits>
+#include <SDL/SDL.h>
+
#include "Log.hh"
#include "Timer.hh"
#include "config.h"
#endif
-#include <SDL/SDL.h>
-
namespace Mf {
{
struct timespec ts;
- ASSERT(clock_gettime(CLOCK_MONOTONIC, &ts) == 0 && "cannot access clock");
+ int result = clock_gettime(CLOCK_MONOTONIC, &ts);
+ ASSERT(result == 0 && "cannot access clock");
return Scalar(ts.tv_sec - reference) + Scalar(ts.tv_nsec) / 1000000000.0;
}