aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-18 13:58:04 -0700
committerChris Robinson <[email protected]>2019-09-18 13:58:04 -0700
commit24a10589522f07e3ff152777a986ad0fb72f2935 (patch)
tree9cd54a5a19013c94b0b7910e59af4ca2d3bce5ad /common
parentb8f64155e9b5e2a048f4f055af235a210bcdedc7 (diff)
Work around MSVC's lack of standard _Pragma support
Diffstat (limited to 'common')
-rw-r--r--common/almalloc.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
index fd8d4be7..e021337b 100644
--- a/common/almalloc.h
+++ b/common/almalloc.h
@@ -12,19 +12,19 @@
#ifdef _MSC_VER
-#define DIAGNOSTIC_PUSH _Pragma("warning(push)")
+#define DIAGNOSTIC_PUSH __pragma(warning(push))
#define GNUDIAGNOSTIC(x)
-#define MVSDIAGNOSTIC(x) _Pragma(x)
-#define DIAGNOSTIC_POP _Pragma("warning(pop)")
+#define MVSDIAGNOSTIC(...) __pragma(__VA_ARGS__)
+#define DIAGNOSTIC_POP __pragma(warning(pop))
#elif defined(__GNUC__) || defined(__clang__)
#define DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
#define GNUDIAGNOSTIC(x) _Pragma(x)
-#define MVSDIAGNOSTIC(x)
+#define MVSDIAGNOSTIC(...)
#define DIAGNOSTIC_POP _Pragma("GCC diagnostic push")
#else
#define DIAGNOSTIC_PUSH
#define GNUDIAGNOSTIC(x)
-#define MVSDIAGNOSTIC(x)
+#define MVSDIAGNOSTIC(...)
#define DIAGNOSTIC_POP
#endif
@@ -113,7 +113,7 @@ inline T* assume_aligned(T *ptr) noexcept
* destructor is trivial (a no-op). So disable that warning for this call.
*/
DIAGNOSTIC_PUSH
-MVSDIAGNOSTIC("warning(disable : 4100)")
+MVSDIAGNOSTIC(warning(disable : 4100))
template<typename T>
inline void destroy_at(T *ptr) { ptr->~T(); }
DIAGNOSTIC_POP
@@ -258,7 +258,7 @@ struct FlexArray {
const index_type mSize;
DIAGNOSTIC_PUSH
GNUDIAGNOSTIC("GCC diagnostic ignored \"-Wpedantic\"")
-MVSDIAGNOSTIC("warning(disable : 4200)")
+MVSDIAGNOSTIC(warning(disable : 4200))
alignas(alignment) element_type mArray[0];
DIAGNOSTIC_POP