From: Pavel Labath Date: Fri, 14 Dec 2018 14:25:20 +0000 (+0000) Subject: Fix build with older (<3.0) swigs X-Git-Tag: llvmorg-8.0.0-rc1~2108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=091fcdb10b8230ac62e77597a14d24304c253ab9;p=platform%2Fupstream%2Fllvm.git Fix build with older (<3.0) swigs It turns out it wasn't the compilers, but swig who had issues with my previous patch -- older versions do not recognise the "constexpr" keyword. Fortunately, that can be fixed the same way we fix all other swig incompatibilities: #ifndef SWIG. llvm-svn: 349153 --- diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 604f83c..1c4d6f5 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -12,10 +12,13 @@ #include +#ifndef SWIG // Macro to enable bitmask operations on an enum. Without this, Enum | Enum // gets promoted to an int, so you have to say Enum a = Enum(eFoo | eBar). If // you mark Enum with LLDB_MARK_AS_BITMASK_ENUM(Enum), however, you can simply // write Enum a = eFoo | eBar. +// Unfortunately, swig<3.0 doesn't recognise the constexpr keyword, so remove +// this entire block, as it is not necessary for swig processing. #define LLDB_MARK_AS_BITMASK_ENUM(Enum) \ constexpr Enum operator|(Enum a, Enum b) { \ return static_cast( \ @@ -39,6 +42,9 @@ a = a & b; \ return a; \ } +#else +#define LLDB_MARK_AS_BITMASK_ENUM(Enum) +#endif #ifndef SWIG // With MSVC, the default type of an enum is always signed, even if one of the