gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / lib / stdnoreturn.in.h
index 5ca3063..d62737f 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdnoreturn.h>.
 
-   Copyright 2012 Free Software Foundation, Inc.
+   Copyright 2012-2013 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* The definition of _Noreturn is copied here.  */
 
-#define noreturn _Noreturn
+#if 1200 <= _MSC_VER
+/* Standard include files on this platform contain declarations like
+   "__declspec (noreturn) void abort (void);".  "#define noreturn
+   _Noreturn" would cause this declaration to be rewritten to the
+   invalid "__declspec (__declspec (noreturn)) void abort (void);".
+   Instead, define noreturn to empty, so that such declarations are
+   rewritten to "__declspec () void abort (void);", which is
+   equivalent to "void abort (void);"; this gives up on noreturn's
+   advice to the compiler but at least it is valid code.  */
+# define noreturn /*empty*/
+#else
+# define noreturn _Noreturn
+#endif
 
 /* Did he ever return?
    No he never returned