のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

RELEASE_ASSERT

TARGET_BUILD_TYPE=release

     53 #ifdef NDEBUG
     54 /* Disable ASSERT* macros in release mode. */
     55 #define ASSERTIONS_DISABLED_DEFAULT 1 <=========こっちだな
     56 #else
     57 #define ASSERTIONS_DISABLED_DEFAULT 0
     58 #endif
     59 
    363 /* RELEASE_ASSERT
    364 
    365    Use in places where failure of an assertion indicates a definite security
    366    vulnerability from which execution must not continue even in a release build.
    367    Please sure to file bugs for these failures using the security template:
    368       http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
    369 */
    370 
    371 #if ASSERT_DISABLED
    372 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
    373 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
    374 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH()
    375 #else
    376 #define RELEASE_ASSERT(assertion) ASSERT(assertion)
    377 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__)
    378 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
    379 #endif
    139 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest possible way with no attempt at logging. */
    140 #ifndef IMMEDIATE_CRASH
    141 #if COMPILER(GCC)
    142 #define IMMEDIATE_CRASH() __builtin_trap()
    143 #else
    144 #define IMMEDIATE_CRASH() ((void(*)())0)()
    145 #endif
    146 #endif