VirtualBox

Changeset 77109 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Feb 1, 2019 10:41:42 AM (6 years ago)
Author:
vboxsync
Message:

assertcompile.h: Use _Static_assert() when compiling in C mode and static asserts are available, static_assert() is C++11 only while _Static_assert() is for C11. (clang compile fix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/assertcompile.h

    r76585 r77109  
    108108 */
    109109#ifdef RTASSERT_HAVE_STATIC_ASSERT
    110 # define AssertCompile(expr)    static_assert(!!(expr), #expr)
     110# ifdef __cplusplus
     111#  define AssertCompile(expr)    static_assert(!!(expr), #expr)
     112# else
     113#  define AssertCompile(expr)    _Static_assert(!!(expr), #expr)
     114# endif
    111115#else
    112116# define AssertCompile(expr)    AssertCompileNS(expr)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette