--- config.h.in +++ config.h.in @@ -1806,9 +1806,16 @@ /* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ #undef _NETBSD_SOURCE +/* https://clang.llvm.org/docs/LanguageExtensions.html */ +#ifndef __has_attribute // Optional of course. +# define __has_attribute(x) 0 // Compatibility non-clang compilers. +#endif + /* The _Noreturn keyword of C11. */ #ifndef _Noreturn -# if (defined __cplusplus \ +# if defined(__APPLE__) && defined(__clang__) && (__has_attribute(__noreturn__) == 1) + /* Don't do anything. Stay out of code paths below. */ +# elif (defined __cplusplus \ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ || (defined _MSC_VER && 1900 <= _MSC_VER))) # define _Noreturn [[noreturn]] --- src/gl/_Noreturn.h +++ src/gl/_Noreturn.h @@ -14,8 +14,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* https://clang.llvm.org/docs/LanguageExtensions.html */ +#ifndef __has_attribute // Optional of course. +# define __has_attribute(x) 0 // Compatibility non-clang compilers. +#endif + #ifndef _Noreturn -# if (defined __cplusplus \ +# if defined(__APPLE__) && defined(__clang__) && (__has_attribute(__noreturn__) == 1) + /* Don't do anything. Stay out of code paths below. */ +# elif (defined __cplusplus \ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ || (defined _MSC_VER && 1900 <= _MSC_VER))) # define _Noreturn [[noreturn]]