Ignore:
Timestamp:
Jun 16, 2017, 9:07:21 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
42b0d73
Parents:
667c7da
Message:

Added verify macro for asserts only present in debug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/libhdr/libdebug.h

    r667c7da r4aa2fb2  
    1818
    1919#ifdef __CFA_DEBUG__
    20       #define LIB_DEBUG_DO(x) x
    21       #define LIB_NO_DEBUG_DO(x) ((void)0)
     20        #define LIB_DEBUG_DO(x) x
     21        #define LIB_NO_DEBUG_DO(x) ((void)0)
    2222#else
    23       #define LIB_DEBUG_DO(x) ((void)0)
    24       #define LIB_NO_DEBUG_DO(x) x     
     23        #define LIB_DEBUG_DO(x) ((void)0)
     24        #define LIB_NO_DEBUG_DO(x) x     
    2525#endif
     26
     27#if !defined(NDEBUG) && (defined(__CFA_DEBUG__) || defined(__CFA_VERIFY__))
     28        #define verify(x) assert(x)
     29        #define verifyf(x, ...) assertf(x, __VA_ARGS__)
     30#else
     31        #define verify(x)
     32        #define verifyf(x, ...)
     33#endif
     34
    2635
    2736#ifdef __cforall
Note: See TracChangeset for help on using the changeset viewer.