Ignore:
Timestamp:
Aug 1, 2017, 8:58:22 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
f1a4ccb
Parents:
5c80197
Message:

Moved assertf from cassert to assert.h, which was necessary for format warnings

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/include/cassert

    r5c80197 re59c088  
    1818// IWYU pragma: private, include <cassert>
    1919
    20 #include_next <assert.h>
     20#include_next <cassert>
    2121
    22 #define __STRINGIFY__(str) #str
    23 #define __VSTRINGIFY__(str) __STRINGIFY__(str)
    24 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
     22#ifdef NDEBUG
    2523
    26 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));
     24#define assertf(expr, fmt, ...) (__ASSERT_VOID_ASSERT (0))
     25
     26#else
     27
     28#define assertf(expr, fmt, ...) ((expr) \
     29        ? (__ASSERT_VOID_CAST (0)) \
     30        : __assert_fail_f( #expr, __FILE__, __LINE__, \
     31        __ASSERT_FUNCTION, fmt, ## __VA_ARGS__ ))
     32
     33void __assert_fail_f(   const char *assertion, const char *file,
     34                                                unsigned int line, const char *function,
     35                                                const char *fmt, ...
     36        ) __attribute__((noreturn, format(printf, 5, 6)));
     37
     38#endif
    2739
    2840template<typename T, typename U>
Note: See TracChangeset for help on using the changeset viewer.