From ce11f0fee9b9a4bfd18a4d4b9eeb276af12c5610 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Thu, 11 May 2000 06:04:39 +0000 Subject: [PATCH] Check volatility of sig_atomic_t. --- acconfig.h | 4 ++++ configure.in | 26 ++++++++++++++++++++++++-- globals.h | 6 +++--- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/acconfig.h b/acconfig.h index ce77e651..f038d19c 100644 --- a/acconfig.h +++ b/acconfig.h @@ -175,3 +175,7 @@ /* 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 diff --git a/configure.in b/configure.in index 1c515af1..904391dc 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/globals.h b/globals.h index e2d3c3a0..47c3cdfc 100644 --- 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; -- 2.40.0