summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-25 23:21:06 +0800
committerGitHub <noreply@github.com>2023-04-25 23:21:06 +0800
commit58858297fd73602cfb7507ce23b0b9e3d9ded2be (patch)
tree8f43deb6fcae4a953feb1b8d5d5f138717884ee1 /slang.h
parent7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (diff)
Bump glm and stb + small neatenings (#2831)
* bump glm to fix c++20 warnings * bump stb_image to fix c++20 warnings * Use static_assert for SLANG_COMPILE_TIME_ASSERT * Remove uses of deprecated is_pod * Remove bit operations between different enums
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/slang.h b/slang.h
index 1b9302036..1bea9c4be 100644
--- a/slang.h
+++ b/slang.h
@@ -252,10 +252,6 @@ convention for interface methods.
// GCC Specific
#if SLANG_GCC_FAMILY
-// This doesn't work on clang - because the typedef is seen as multiply defined, use the line numbered version defined later
-# if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) || defined(__ORBIS__))
-# define SLANG_COMPILE_TIME_ASSERT(exp) typedef char SlangCompileTimeAssert_Dummy[(exp) ? 1 : -1] __attribute__((unused))
-# endif
# define SLANG_NO_INLINE __attribute__((noinline))
# define SLANG_FORCE_INLINE inline __attribute__((always_inline))
@@ -289,7 +285,8 @@ convention for interface methods.
#endif
#ifndef SLANG_COMPILE_TIME_ASSERT
-# define SLANG_COMPILE_TIME_ASSERT(exp) typedef char SLANG_CONCAT(SlangCompileTimeAssert,__LINE__)[(exp) ? 1 : -1]
+// TODO(C++17), can use terse static_assert
+# define SLANG_COMPILE_TIME_ASSERT(x) static_assert(x, #x)
#endif
#ifndef SLANG_OFFSET_OF