aboutsummaryrefslogtreecommitdiffstats
path: root/common/pragmadefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/pragmadefs.h')
-rw-r--r--common/pragmadefs.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/pragmadefs.h b/common/pragmadefs.h
new file mode 100644
index 00000000..1d0af066
--- /dev/null
+++ b/common/pragmadefs.h
@@ -0,0 +1,21 @@
+#ifndef PRAGMADEFS_H
+#define PRAGMADEFS_H
+
+#if defined(_MSC_VER)
+#define DIAGNOSTIC_PUSH __pragma(warning(push))
+#define DIAGNOSTIC_POP __pragma(warning(pop))
+#define std_pragma(...)
+#define msc_pragma __pragma
+#else
+#if defined(__GNUC__) || defined(__clang__)
+#define DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
+#define DIAGNOSTIC_POP _Pragma("GCC diagnostic push")
+#else
+#define DIAGNOSTIC_PUSH
+#define DIAGNOSTIC_POP
+#endif
+#define std_pragma _Pragma
+#define msc_pragma(...)
+#endif
+
+#endif /* PRAGMADEFS_H */