1275970Scy/* A substitute for ISO C11 <stdnoreturn.h>. 2275970Scy 3285169Scy Copyright 2012-2015 Free Software Foundation, Inc. 4275970Scy 5275970Scy This program is free software; you can redistribute it and/or modify 6275970Scy it under the terms of the GNU Lesser General Public License as published by 7275970Scy the Free Software Foundation; either version 2.1, or (at your option) 8275970Scy any later version. 9275970Scy 10275970Scy This program is distributed in the hope that it will be useful, 11275970Scy but WITHOUT ANY WARRANTY; without even the implied warranty of 12275970Scy MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13275970Scy GNU Lesser General Public License for more details. 14275970Scy 15275970Scy You should have received a copy of the GNU Lesser General Public License 16275970Scy along with this program; if not, see <http://www.gnu.org/licenses/>. */ 17275970Scy 18275970Scy/* Written by Paul Eggert. */ 19275970Scy 20275970Scy#ifndef noreturn 21275970Scy 22275970Scy/* ISO C11 <stdnoreturn.h> for platforms that lack it. 23275970Scy 24275970Scy References: 25275970Scy ISO C11 (latest free draft 26275970Scy <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>) 27275970Scy section 7.23 */ 28275970Scy 29275970Scy/* The definition of _Noreturn is copied here. */ 30275970Scy 31275970Scy#if 1200 <= _MSC_VER 32275970Scy/* Standard include files on this platform contain declarations like 33275970Scy "__declspec (noreturn) void abort (void);". "#define noreturn 34275970Scy _Noreturn" would cause this declaration to be rewritten to the 35275970Scy invalid "__declspec (__declspec (noreturn)) void abort (void);". 36275970Scy Instead, define noreturn to empty, so that such declarations are 37275970Scy rewritten to "__declspec () void abort (void);", which is 38275970Scy equivalent to "void abort (void);"; this gives up on noreturn's 39275970Scy advice to the compiler but at least it is valid code. */ 40275970Scy# define noreturn /*empty*/ 41275970Scy#else 42275970Scy# define noreturn _Noreturn 43275970Scy#endif 44275970Scy 45275970Scy/* Did he ever return? 46275970Scy No he never returned 47275970Scy And his fate is still unlearn'd ... 48275970Scy -- Steiner J, Hawes BL. M.T.A. (1949) */ 49275970Scy 50275970Scy#endif /* noreturn */ 51