[assert] Exclude static_assert macro when using C++
Macro cannot be removed because it breaks lpclink2-lpcboot and others.
Fixes errors like:
In file included from third_party/lk/include/lib/page_alloc.h:32:0,
from app/fletch/loader.cpp:15:
third_party/lk/include/kernel/vm.h:70:96: error: macro "static_assert" passed 2 arguments, but takes just 1
STATIC_ASSERT(__offsetof(struct mmu_initial_mapping, phys) == __MMU_INITIAL_MAPPING_PHYS_OFFSET);
^
third_party/lk/include/kernel/vm.h:70:1: warning: identifier 'static_assert' is a keyword in C++11 [-Wc++0x-compat]
BUG=
R=travisg@google.com
Review URL: https://codereview.chromium.org/1496163002 .
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
#endif
|
||||
|
||||
#define assert(e) DEBUG_ASSERT(e)
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define static_assert(e) STATIC_ASSERT(e)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user