Chromium Code Reviews| Index: mojo/public/c/system/macros.h |
| diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h |
| index 4be024900aedb48c87de3865161c8338520df0ad..322c3be61f7cb8f7d9cac345770504537964df97 100644 |
| --- a/mojo/public/c/system/macros.h |
| +++ b/mojo/public/c/system/macros.h |
| @@ -27,8 +27,10 @@ |
| #endif |
| // This macro is currently C++-only, but we want to use it in the C core.h. |
| -#ifdef __cplusplus |
| // Used to assert things at compile time. |
| +#if __cplusplus >= 201103L |
|
darin (slow to review)
2014/05/04 03:15:15
this header is intended to be seen by a C compiler
Nico
2014/05/04 04:20:12
I think that's fine; undefined symbols evaluate to
|
| +#define MOJO_COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) |
| +#elif defined(__cplusplus) |
| namespace mojo { template <bool> struct CompileAssert {}; } |
| #define MOJO_COMPILE_ASSERT(expr, msg) \ |
| typedef ::mojo::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] |