31 #define ION_ERROR_MESSAGE_MAX_LENGTH 1024
36 #define DEBUG_ERR(x) fprintf(stderr,"\nERROR %d [%s] AT LINE %d IN %s\n" \
37 , (int)(x), ion_error_to_str(x) \
38 , (int)__LINE__, __location_display_name__)
39 #define DEBUG_ERRMSG(x,m) fprintf(stderr,"\nERROR %d [%s] WITH MESSAGE '%s' AT LINE %d IN %s\n" \
40 , (int)(x), ion_error_to_str(x) \
42 , (int)__LINE__, __location_display_name__)
43 #define BREAK ion_helper_breakpoint()
44 #define ENTER(f,l,c) ion_helper_enter(f, l, c)
45 #define RETURN(f,l,c,e) return ion_helper_return(f, l, c, e)
47 #define __location_name__ __file__
48 #define __location_display_name__ ion_helper_short_filename(__file__)
49 #define ENTER_FILE static char *__file__ = __FILE__
51 #define __location_name__ __func__
52 #define __location_display_name__ __func__
53 #define ENTER_FILE static const char *__file__ = __func__
55 #define FN_DEF static long __count__ = 0; \
57 int __line__ = __LINE__; \
58 long __temp__ = ENTER(__file__, __line__, __count__);
61 #define DEBUG_ERRMSG(x,m)
62 #define BREAK ion_helper_breakpoint()
64 #define RETURN(f,l,c,e) return e
68 #define iENTER FN_DEF iERR err = IERR_OK
69 #define DONTFAILWITH(x) { err = x; goto fail; }
70 #define FAILWITH(x) { BREAK; DEBUG_ERR(x); err = x; goto fail; }
71 #define FAILWITHMSG(x,s) { BREAK; DEBUG_ERRMSG(x,s); err = x; goto fail; }
72 #define IONCHECK(x) { err = x; if (err) goto fail; }
73 #define SUCCEED() { err = IERR_OK; goto fail; }
74 #define iRETURN fail: RETURN(__location_name__, __line__, __count__++, err)
84 #define UPDATEERROR(x) { iERR errBackup = (x); if (err == IERR_OK) { err = errBackup; }}
86 #define ION_TIMESTAMP_STRING_LENGTH 55
88 #define ION_VERSION_MARKER_LENGTH 4
93 ION_API_EXPORT BOOL ion_debug_has_tracing(
void);
94 ION_API_EXPORT
void ion_debug_set_tracing(BOOL state);
GLOBAL BOOL g_ion_debug_tracing INITTO(FALSE)
#define GLOBAL
Definition: ion_types.h:41