mariadb/newbrt/toku_assert.c
Yoni Fogel 0bed4483eb Addresses #1185
omt-test now works in windows/cygwin/icc (although not through makefile)

newbrt/tests/makefile now supports icc in cygwin (more so than before)


git-svn-id: file:///svn/tokudb.1131b+1080a+1185+nostatementexprs@6494 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:22 -04:00

24 lines
665 B
C

#include "portability.h"
#include "toku_assert.h"
#include <stdlib.h>
#include <stdio.h>
int toku_continue_on_assert_failure=0;
static void toku_assert_failed_but_continue_anyway (void) __attribute__((noinline));
static void
toku_assert_failed_but_continue_anyway (void) {
printf("Assertion failed, but continuing anyway\n");
}
void toku_do_assert(int expr,const char* expr_as_string,const char *function,const char*file,int line) {
if (expr==0) {
fprintf(stderr, "%s:%d %s: Assertion `%s' failed\n", file,line,function,expr_as_string);
if (!toku_continue_on_assert_failure)
abort();
else
toku_assert_failed_but_continue_anyway();
}
}