Commit 5c519908 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add a SWIFT_DEVELOP_MODE flag to enable development code options

Just uses abort() instead of exit() in non-MPI code
parent a96e0f2d
......@@ -41,6 +41,12 @@ AX_CHECK_ENABLE_DEBUG
AC_PROG_CC
AM_PROG_CC_C_O
# If debug is selected then we also define SWIFT_DEVELOP_MODE to control
# and developer code options.
if test "x$ax_enable_debug" != "xno"; then
AC_DEFINE([SWIFT_DEVELOP_MODE],1,[Enable developer code options])
fi
# Enable POSIX and platform extension preprocessor macros.
AC_USE_SYSTEM_EXTENSIONS
......
......@@ -36,6 +36,12 @@
/* Local headers. */
#include "clocks.h"
#ifdef SWIFT_DEVELOP_MODE
#define swift_abort(errcode) abort()
#else
#define swift_abort(errcode) exit(errcode)
#endif
/**
* @brief Error macro. Prints the message given in argument and aborts.
*
......@@ -54,7 +60,7 @@ extern int engine_rank;
({ \
fprintf(stderr, "%s %s:%s():%i: " s "\n", clocks_get_timesincestart(), \
__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
abort(); \
swift_abort(1); \
})
#endif
......@@ -130,7 +136,7 @@ extern int engine_rank;
fprintf(stderr, "%s %s:%s():%i: FAILED ASSERTION: " #expr " \n", \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__); \
fflush(stderr); \
abort(); \
swift_abort(1); \
} \
})
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment