Ignore:
Timestamp:
Feb 13, 2012, 9:47:25 AM (13 years ago)
Author:
[email protected]
Message:

Use C11's _Static_assert for COMPILE_ASSERT if it is available
https://bugs.webkit.org/show_bug.cgi?id=78506

Rubber-stamped by Antti Koivisto.

Use C11's _Static_assert for COMPILE_ASSERT if it is available to give slightly
better error messages.

  • wtf/Assertions.h:

Use _Static_assert if it is available.

  • wtf/Compiler.h:

Add COMPILER_SUPPORTS support for _Static_assert when using the LLVM Compiler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/Assertions.h

    r105267 r107581  
    323323/* COMPILE_ASSERT */
    324324#ifndef COMPILE_ASSERT
     325#if COMPILER_SUPPORTS(C_STATIC_ASSERT)
     326#define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name)
     327#else
    325328#define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1]
     329#endif
    326330#endif
    327331
Note: See TracChangeset for help on using the changeset viewer.