summaryrefslogtreecommitdiffstats
path: root/gl/lib/stddef.in.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gl/lib/stddef.in.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/gl/lib/stddef.in.h b/gl/lib/stddef.in.h
index 431e819..fa8998d 100644
--- a/gl/lib/stddef.in.h
+++ b/gl/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -58,7 +58,7 @@
/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
type with alignment 4, but 'long' has alignment 8. */
-# if defined _AIX && defined __LP64__
+# if defined _AIX && defined __LP64__ && !@HAVE_MAX_ALIGN_T@
# if !GNULIB_defined_max_align_t
# ifdef _MAX_ALIGN_T
/* /usr/include/stddef.h has already defined max_align_t. Override it. */
@@ -101,11 +101,33 @@ typedef long max_align_t;
# ifndef _@GUARD_PREFIX@_STDDEF_H
# define _@GUARD_PREFIX@_STDDEF_H
-/* This file uses _Noreturn. */
+/* This file uses _Noreturn, _GL_ATTRIBUTE_NOTHROW. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+#ifndef _GL_ATTRIBUTE_NOTHROW
+# if defined __cplusplus
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if __cplusplus >= 201103L
+# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
+# else
+# define _GL_ATTRIBUTE_NOTHROW throw ()
+# endif
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+# else
+# if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+# endif
+#endif
+
/* Some platforms lack wchar_t. */
#if !@HAVE_WCHAR_T@
# define wchar_t int
@@ -178,7 +200,7 @@ extern
_Noreturn
void abort (void)
# if defined __cplusplus && (__GLIBC__ >= 2)
-throw ()
+_GL_ATTRIBUTE_NOTHROW
# endif
;
# define unreachable() abort ()