aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmakeconfig.h.in9
2 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 902c13a016..6cbc2a9c4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -434,11 +434,14 @@ endif()
if(WIN32)
add_definitions(-D_NEED_VAR_IMPORT_)
set(WS_VAR_IMPORT "__declspec(dllimport) extern")
+ set(WS_MSVC_NORETURN "__declspec(noreturn)")
# Disable deprecation
if(MSVC80 OR MSVC90)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
+else()
+ set(WS_MSVC_NORETURN " ")
endif()
configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index d739c42174..720f46140e 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -354,6 +354,15 @@
dynamically-linked libraries */
#define WS_VAR_IMPORT @WS_VAR_IMPORT@
+/* Define WS_MSVC_NORETURN appropriately for declarations of routines that
+ never return (just like Charlie on the MTA).
+
+ Note that MSVC++ expects __declspec(noreturn) to precede the function
+ name and GCC, as far as I know, expects __attribute__((noreturn)) to
+ follow the function name, so we need two different flavors of
+ noreturn tag. */
+#define WS_MSVC_NORETURN @WS_MSVC_NORETURN@
+
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
/* Note: not use in the code */