NEURON
hocassrt.h
Go to the documentation of this file.
1 
2 #ifndef hocassrt_h
3 #define hocassrt_h
4 #include <assert.h>
5 #undef assert
6 #undef _assert
7 #ifndef NDEBUG
8 #ifndef stderr
9 #include <stdio.h>
10 #endif
11 
12 #if defined(__cplusplus)
13 extern "C" {
14 #endif
15 
16 extern void hoc_execerror(const char*, const char*);
17 
18 #if defined(__cplusplus)
19 }
20 #endif
21 
22 
23 #if defined(__STDC__)
24 #define assert(ex) \
25  { \
26  if (!(ex)) { \
27  fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
28  hoc_execerror(#ex, (char*) 0); \
29  } \
30  }
31 #else
32 #define assert(ex) \
33  { \
34  if (!(ex)) { \
35  fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
36  hoc_execerror("ex", (char*) 0); \
37  } \
38  }
39 #endif
40 #else
41 #define _assert(ex) ;
42 #define assert(ex) ;
43 #endif
44 #endif
void hoc_execerror(const char *, const char *)
Definition: hoc.cpp:754