summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index c726fc23c..00e22e676 100644
--- a/slang.h
+++ b/slang.h
@@ -276,6 +276,16 @@ convention for interface methods.
/// SLANG_INLINE exists to have a way to inline consistent with SLANG_ALWAYS_INLINE
#define SLANG_INLINE inline
+// If explicilty disabled and not set, set to not available
+#if !defined(SLANG_HAS_EXCEPTIONS) && defined(SLANG_DISABLE_EXCEPTIONS)
+# define SLANG_HAS_EXCEPTIONS 0
+#endif
+
+// If not set, the default is exceptions are available
+#ifndef SLANG_HAS_EXCEPTIONS
+# define SLANG_HAS_EXCEPTIONS 1
+#endif
+
// Other defines
#define SLANG_STRINGIZE_HELPER(X) #X
#define SLANG_STRINGIZE(X) SLANG_STRINGIZE_HELPER(X)
@@ -311,6 +321,7 @@ convention for interface methods.
# define SLANG_HAS_ENUM_CLASS 1
# define SLANG_OVERRIDE override
# endif
+
// Gcc
#elif SLANG_GCC_FAMILY
// Check for C++11
@@ -325,6 +336,12 @@ convention for interface methods.
# define SLANG_OVERRIDE override
# endif
# endif
+
+// TODO(JS): Not used in previous code. Left here as may be useful on some other version.
+// #define SLANG_RETURN_NEVER __attribute__((__noreturn__))
+
+# define SLANG_RETURN_NEVER [[noreturn]]
+
# endif // SLANG_GCC_FAMILY
// Visual Studio
@@ -342,6 +359,8 @@ convention for interface methods.
# define SLANG_HAS_ENUM_CLASS 1
# endif
+# define SLANG_RETURN_NEVER __declspec(noreturn)
+
# endif // SLANG_VC
// Set non set
@@ -357,6 +376,10 @@ convention for interface methods.
#endif // __cplusplus
+#ifndef SLANG_RETURN_NEVER
+# define SLANG_RETURN_NEVER /* empty */
+#endif // SLANG_RETURN_NEVER
+
/* Macros for detecting processor */
#if defined(_M_ARM) || defined(__ARM_EABI__)
// This is special case for nVidia tegra