From: Todd C. Miller Date: Fri, 3 Oct 2008 13:59:39 +0000 (+0000) Subject: Add tests for __signed char and signed char. X-Git-Tag: SUDO_1_7_0~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99cdf6dc8d5e43942ca7f8fb07e3fdf9f71607a0;p=sudo Add tests for __signed char and signed char. --- diff --git a/config.h.in b/config.h.in index ff51e8668..ddb71b7f7 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,10 @@ #ifndef _SUDO_CONFIG_H #define _SUDO_CONFIG_H +/* Define to `signed' or nothing if compiler does not support a signed + type qualifier. */ +#undef __signed + /* Define to 1 if the `syslog' function returns a non-zero int to denote failure. */ #undef BROKEN_SYSLOG @@ -353,9 +357,6 @@ /* Define to 1 if has the sigaction_t typedef. */ #undef HAVE_SIGACTION_T -/* Define to 1 if the system has the type `sig_atomic_t'. */ -#undef HAVE_SIG_ATOMIC_T - /* Define to 1 if you use S/Key. */ #undef HAVE_SKEY diff --git a/configure b/configure index 3d7545394..cdcfa85de 100755 --- a/configure +++ b/configure @@ -14335,6 +14335,129 @@ _ACEOF fi +{ echo "$as_me:$LINENO: checking for __signed char" >&5 +echo $ECHO_N "checking for __signed char... $ECHO_C" >&6; } +if test "${ac_cv_type___signed_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef __signed char ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type___signed_char=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type___signed_char=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type___signed_char" >&5 +echo "${ECHO_T}$ac_cv_type___signed_char" >&6; } +if test $ac_cv_type___signed_char = yes; then + : +else + { echo "$as_me:$LINENO: checking for signed char" >&5 +echo $ECHO_N "checking for signed char... $ECHO_C" >&6; } +if test "${ac_cv_type_signed_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef signed char ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signed_char=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signed_char=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_char" >&5 +echo "${ECHO_T}$ac_cv_type_signed_char" >&6; } +if test $ac_cv_type_signed_char = yes; then + cat >>confdefs.h <<\_ACEOF +#define __signed signed +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define __signed +_ACEOF + +fi + +fi + { echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6; } if test "${ac_cv_type_sig_atomic_t+set}" = set; then @@ -14391,12 +14514,7 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6; } if test $ac_cv_type_sig_atomic_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SIG_ATOMIC_T 1 -_ACEOF - - + : else cat >>confdefs.h <<\_ACEOF #define sig_atomic_t int @@ -24717,6 +24835,8 @@ fi + + diff --git a/configure.in b/configure.in index 1ac289554..01a4fb096 100644 --- a/configure.in +++ b/configure.in @@ -1726,7 +1726,8 @@ dnl typedef checks dnl AC_TYPE_MODE_T AC_TYPE_UID_T -AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int)], [#include +AC_CHECK_TYPE([__signed char], [], [AC_CHECK_TYPE([signed char], [AC_DEFINE(__signed, signed)], [AC_DEFINE(__signed, [])])]) +AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include #include ]) AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], [], [#include #include ]) @@ -2578,6 +2579,7 @@ AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.]) AH_TEMPLATE(USE_TTY_TICKETS, [Define to 1 if you want a different ticket file for each tty.]) AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.]) AH_TEMPLATE(sig_atomic_t, [Define to `int' if does not define.]) +AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.]) dnl dnl Bits to copy verbatim into config.h.in