Changeset 140577 in webkit


Ignore:
Timestamp:
Jan 23, 2013 1:15:29 PM (11 years ago)
Author:
oliver@apple.com
Message:

Add RELEASE_ASSERT (and a few friends)
https://bugs.webkit.org/show_bug.cgi?id=107725

Reviewed by Filip Pizlo.

Adding a few macros to make release mode assertions easier and more readable.
Also makes same assertions more useful in debug builds.

  • wtf/Assertions.h:
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r140483 r140577  
     12013-01-23  Oliver Hunt  <oliver@apple.com>
     2
     3        Add RELEASE_ASSERT (and a few friends)
     4        https://bugs.webkit.org/show_bug.cgi?id=107725
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Adding a few macros to make release mode assertions easier and more readable.
     9        Also makes same assertions more useful in debug builds.
     10
     11        * wtf/Assertions.h:
     12
    1132013-01-22  Joshua Bell  <jsbell@chromium.org>
    214
  • trunk/Source/WTF/wtf/Assertions.h

    r140236 r140577  
    391391#endif
    392392
     393#if ASSERT_DISABLED
     394#define RELEASE_ASSERT(assertion) (!(assertion) ? (CRASH()) : (void)0)
     395#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
     396#define RELEASE_ASSERT_NOT_REACHED() CRASH()
     397#else
     398#define RELEASE_ASSERT(assertion) ASSERT(assertion)
     399#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__)
     400#define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
     401#endif
     402
    393403#endif /* WTF_Assertions_h */
Note: See TracChangeset for help on using the changeset viewer.