summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-04-23 12:38:40 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2019-04-23 09:38:40 -0700
commit7a71b86aadda83d16dadf809be137c7551f31464 (patch)
tree6ef07568ffbc86bde6d54d7b809d8e03a2e29eea /source
parenta81efa750f093fdbfcf28c5d9bd619fca119bcde (diff)
Fix 'unreachable code' stopping compilation on VS2017. (#949)
Diffstat (limited to 'source')
-rw-r--r--source/slang/object-meta-begin.h7
-rw-r--r--source/slang/object-meta-end.h6
2 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/object-meta-begin.h b/source/slang/object-meta-begin.h
index e4187a600..7340ed413 100644
--- a/source/slang/object-meta-begin.h
+++ b/source/slang/object-meta-begin.h
@@ -34,3 +34,10 @@
#define SIMPLE_SYNTAX_CLASS(NAME, BASE) SYNTAX_CLASS(NAME, BASE) END_SYNTAX_CLASS()
+// Hack to remove 'warning C4702: unreachable code' on VS2017, blocking compilation
+// Note! This is matched in object-meta-end.h
+#if _MSC_VER >= 1910
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
+
diff --git a/source/slang/object-meta-end.h b/source/slang/object-meta-end.h
index ccfd5f96e..96f41d39d 100644
--- a/source/slang/object-meta-end.h
+++ b/source/slang/object-meta-end.h
@@ -9,3 +9,9 @@
#undef DECL_FIELD
#undef RAW
#undef SIMPLE_SYNTAX_CLASS
+
+// Hack to remove 'warning C4702: unreachable code' on VS2017, blocking compilation
+// Note! This is matched in object-meta-begin.h
+#if _MSC_VER >= 1910
+#pragma warning(pop)
+#endif