1
1

Clarify of sig_atomic_t usage (got from Mutt).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2012-10-31 11:33:50 +04:00
родитель 82bb9c39da
Коммит 1d3132c08f
6 изменённых файлов: 39 добавлений и 5 удалений

Просмотреть файл

@ -186,6 +186,40 @@ AC_TYPE_UID_T
AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
AH_TEMPLATE([sig_atomic_t],
[/* Define to `int' if <signal.h> doesn't define.])
AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
[Some systems declare sig_atomic_t as volatile, some others -- no.
This define will have value `sig_atomic_t' or
`volatile sig_atomic_t' accordingly.])
AC_MSG_CHECKING(for sig_atomic_t in signal.h)
AC_EGREP_HEADER(sig_atomic_t,signal.h,
[
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
dnl ############################################################################
dnl Check for functions

Просмотреть файл

@ -265,7 +265,7 @@ typedef struct
gboolean alternate_plus_minus;
/* Set if the window has changed it's size */
volatile sig_atomic_t winch_flag;
SIG_ATOMIC_VOLATILE_T winch_flag;
} tty;
struct

Просмотреть файл

@ -62,7 +62,7 @@ int mc_tty_frm[MC_TTY_FRM_MAX];
/*** file scope variables ************************************************************************/
static volatile sig_atomic_t got_interrupt = 0;
static SIG_ATOMIC_VOLATILE_T got_interrupt = 0;
/*** file scope functions ************************************************************************/
/* --------------------------------------------------------------------------------------------- */

Просмотреть файл

@ -36,7 +36,7 @@
/*** global variables ****************************************************************************/
volatile sig_atomic_t got_sigpipe = 0;
SIG_ATOMIC_VOLATILE_T got_sigpipe = 0;
/*** file scope macro definitions ****************************************************************/

Просмотреть файл

@ -16,7 +16,7 @@
/*** global variables defined in .c file *********************************************************/
extern volatile sig_atomic_t got_sigpipe;
extern SIG_ATOMIC_VOLATILE_T got_sigpipe;
/*** declarations of public functions ************************************************************/

Просмотреть файл

@ -319,7 +319,7 @@ toggle_panels (void)
vfs_path_t **new_dir_p;
#endif /* ENABLE_SUBSHELL */
volatile sig_atomic_t was_sigwinch = 0;
SIG_ATOMIC_VOLATILE_T was_sigwinch = 0;
channels_down ();
disable_mouse ();