summaryrefslogtreecommitdiff
path: root/lib/signal.in.h
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-03-21 17:57:40 -0600
committerEric Blake <ebb9@byu.net>2009-03-23 04:55:12 -0600
commitbde8c798d44b81439cc2701ae74d39727fe7c105 (patch)
treebc9f43d25f6db1548121f814e0c4d95cba475742 /lib/signal.in.h
parent7f4b1f45ce477f8374d382bd75f5f0a7e865e2c6 (diff)
downloadgnulib-bde8c798d44b81439cc2701ae74d39727fe7c105.tar.gz
signal.h: always support 'volatile sig_atomic_t'
* m4/signal_h.m4 (gl_SIGNAL_H): Check for AIX limitation. (gl_SIGNAL_H_DEFAULTS): Add a default. * modules/signal (Makefile.am): Substitute if needed. * lib/signal.in.h (sig_atomic_t): Redefine if needed, so that users can blindly add volatile. * doc/posix-headers/signal.texi (signal.h): Document it. Reported by Matthew Woehlke. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/signal.in.h')
-rw-r--r--lib/signal.in.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 3c74fd8d4a..5c42fe9e26 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <signal.h>.
- Copyright (C) 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2006-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,6 +41,15 @@
Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
#include <sys/types.h>
+/* On AIX, sig_atomic_t already includes volatile. C99 requires that
+ 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
+ Hence, redefine this to a non-volatile type as needed. */
+#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+typedef int rpl_sig_atomic_t;
+# undef sig_atomic_t
+# define sig_atomic_t rpl_sig_atomic_t
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif