havelib: Support overriding the result of AC_LIB_PREPARE_MULTILIB.
[gnulib.git] / lib / stdnoreturn.in.h
blob9b25a563769e23d6803e1b81253a2f6bb353dfa9
1 /* A substitute for ISO C11 <stdnoreturn.h>.
3 Copyright 2012-2017 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>. */
18 /* Written by Paul Eggert. */
20 #ifndef noreturn
22 /* ISO C11 <stdnoreturn.h> for platforms that lack it.
24 References:
25 ISO C11 (latest free draft
26 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
27 section 7.23 */
29 /* The definition of _Noreturn is copied here. */
31 #if 1200 <= _MSC_VER
32 /* Standard include files on this platform contain declarations like
33 "__declspec (noreturn) void abort (void);". "#define noreturn
34 _Noreturn" would cause this declaration to be rewritten to the
35 invalid "__declspec (__declspec (noreturn)) void abort (void);".
36 Instead, define noreturn to empty, so that such declarations are
37 rewritten to "__declspec () void abort (void);", which is
38 equivalent to "void abort (void);"; this gives up on noreturn's
39 advice to the compiler but at least it is valid code. */
40 # define noreturn /*empty*/
41 #else
42 # define noreturn _Noreturn
43 #endif
45 /* Did he ever return?
46 No he never returned
47 And his fate is still unlearn'd ...
48 -- Steiner J, Hawes BL. M.T.A. (1949) */
50 #endif /* noreturn */