From Roland Knall:
authorJaap Keuter <jaap.keuter@xs4all.nl>
Mon, 21 Feb 2011 21:33:54 +0000 (21:33 -0000)
committerJaap Keuter <jaap.keuter@xs4all.nl>
Mon, 21 Feb 2011 21:33:54 +0000 (21:33 -0000)
WS_MSVC_NORETURN is undeclared under a non-Windows operating system, which
breaks compilation in the files epan/except.c and dumpcap.c as well as any
file including epan/except.h

svn path=/trunk/; revision=36023

CMakeLists.txt
cmakeconfig.h.in

index 902c13a016be622e23ead424a96c692070cd9083..6cbc2a9c4de0a5790fee5d7081fa3eb94035ec2d 100644 (file)
@@ -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)
index d739c4217436b866d544c3620da60ffd88a1107f..720f46140eca68e99994773e491a593f6cc52334 100644 (file)
    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 */