summaryrefslogtreecommitdiff
path: root/src/config.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h.in')
-rw-r--r--src/config.h.in44
1 files changed, 38 insertions, 6 deletions
diff --git a/src/config.h.in b/src/config.h.in
index b4673c9..1dcbf68 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -1604,9 +1604,11 @@
#undef REPLACE_VASNPRINTF
/* File name of the Bourne shell. */
-#if defined __CYGWIN__
-/* Omit the directory part because for 32-bit Cygwin programs in a
- 64-bit Cygwin environment, the Cygwin mounts are not visible. */
+#if defined __CYGWIN__ || defined __ANDROID__
+/* Omit the directory part because
+ - For 32-bit Cygwin programs in a 64-bit Cygwin environment, the Cygwin
+ mounts are not visible.
+ - On Android, /bin/sh does not exist. It's /system/bin/sh instead. */
# define BOURNE_SHELL "sh"
#else
# define BOURNE_SHELL "/bin/sh"
@@ -1833,10 +1835,13 @@
/* The _Noreturn keyword of C11. */
#ifndef _Noreturn
-# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)))
# define _Noreturn [[noreturn]]
-# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
/* _Noreturn works as-is. */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
@@ -1879,6 +1884,33 @@
/* Define to 1 if the system <stdint.h> predates C++11. */
#undef __STDC_LIMIT_MACROS
+/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const