]> granicus.if.org Git - mutt/commitdiff
Check volatility of sig_atomic_t.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 11 May 2000 06:04:39 +0000 (06:04 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 11 May 2000 06:04:39 +0000 (06:04 +0000)
acconfig.h
configure.in
globals.h

index ce77e65171ff02f248e1758d6504d00d01ef5f4f..f038d19cfa57c2746276541087cb9e20647384af 100644 (file)
 /* Define if you have resizeterm, as a function or macro.  */
 #undef HAVE_RESIZETERM
 
+/* Some systems declare sig_atomic_t as volatile, smome others -- no.
+ * This define will have value `sig_atomic_t' or `volatile sig_atomic_t'
+ * accordingly. */
+#undef SIG_ATOMIC_VOLATILE_T
index 1c515af181db38d1936b335c49656c1d0638dc08..904391dcd7ce0e338a9651f4272aab5fc57fce05 100644 (file)
@@ -217,8 +217,30 @@ AC_TYPE_SIGNAL
 
 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
 AC_EGREP_HEADER(sig_atomic_t,signal.h,dnl
-  [ ac_cv_type_sig_atomic_t=yes; AC_MSG_RESULT(yes) ],dnl
-  AC_MSG_RESULT(no); AC_CHECK_TYPE(sig_atomic_t, int))
+  [
+    ac_cv_type_sig_atomic_t=yes;
+    AC_EGREP_HEADER(volatile.*sig_atomic_t,
+                    signal.h,
+                    [
+                        is_sig_atomic_t_volatile=yes;
+                        AC_MSG_RESULT([yes, volatile])
+                    ],
+                    [
+                        is_sig_atomic_t_volatile=no;
+                        AC_MSG_RESULT([yes, non volatile])
+                    ])
+  ],
+  [
+    AC_MSG_RESULT(no)
+    AC_CHECK_TYPE(sig_atomic_t, int)
+    is_sig_atomic_t_volatile=no
+  ])
+if test $is_sig_atomic_t_volatile = 'yes'
+then
+    AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
+else
+    AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
+fi
 
 AC_DECL_SYS_SIGLIST
 
index e2d3c3a02b5988fd1acf9dad37565577078a3031..47c3cdfc259dd23e601ee003e24e2094a377a2c2 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -135,9 +135,9 @@ WHERE short ScoreThresholdRead;
 WHERE short ScoreThresholdFlag;
 
 /* flags for received signals */
-WHERE volatile sig_atomic_t SigAlrm INITVAL (0);
-WHERE volatile sig_atomic_t SigInt INITVAL (0);
-WHERE volatile sig_atomic_t SigWinch INITVAL (0);
+WHERE SIG_ATOMIC_VOLATILE_T SigAlrm INITVAL (0);
+WHERE SIG_ATOMIC_VOLATILE_T SigInt INITVAL (0);
+WHERE SIG_ATOMIC_VOLATILE_T SigWinch INITVAL (0);
 
 WHERE int CurrentMenu;