Skip to content

Commit

Permalink
Check and define sig_t if it's not in signals.h
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 23, 2014
1 parent 0da78b4 commit 29683cc
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions configure
Expand Up @@ -7788,6 +7788,44 @@ $as_echo "#define uint64_t unsigned long long" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sig_t" >&5
$as_echo_n "checking for sig_t... " >&6; }
if ${ac_cv_type_sig_t+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_type_sig_t=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
int
main ()
{
sig_t foo
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_type_sig_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_sig_t" >&5
$as_echo "$ac_cv_type_sig_t" >&6; }
if test "$ac_cv_type_sig_t" != "yes"; then
$as_echo "#define sig_t void(*sig_t)(int)" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default"
if test "x$ac_cv_type___uint128_t" = xyes; then :
Expand Down
9 changes: 9 additions & 0 deletions configure.ac
Expand Up @@ -1098,6 +1098,15 @@ FR_CHECK_TYPE_INCLUDE(
uint64_t, unsigned long long, [uint64_t is required for larger counters]
)

FR_CHECK_TYPE_INCLUDE(
[
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
],
sig_t, void(*sig_t)(int), [signal action callback function]
)

dnl #
dnl # Check for __uint128_t (compiler builtin)
dnl #
Expand Down
3 changes: 3 additions & 0 deletions src/include/autoconf.h.in
Expand Up @@ -541,6 +541,9 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t

/* signal action callback function */
#undef sig_t

/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

Expand Down

0 comments on commit 29683cc

Please sign in to comment.