From eab2f4221f9986f8dd18fc3df2a78308ec9aac04 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 26 Aug 2004 23:13:46 +0000 Subject: [PATCH] * configure.in: Look for uint32_t, not int32_t, since some BSD-ish sys/types.h headers have int32_t and u_int32_t, but only have uint32_t in stdint.h. * types.hin: Change int32_t checks to uint32_t checks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16686 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 8 ++++++++ src/lib/rpc/configure.in | 42 ++++++++++++++++++++-------------------- src/lib/rpc/types.hin | 12 ++++++------ 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 1e90d7fda..2df8c5830 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,11 @@ +2004-08-26 Tom Yu + + * configure.in: Look for uint32_t, not int32_t, since some BSD-ish + sys/types.h headers have int32_t and u_int32_t, but only have + uint32_t in stdint.h. + + * types.hin: Change int32_t checks to uint32_t checks. + 2004-08-17 Tom Yu * svc.c (svc_getreqset): Allocate cred and verf memory to diff --git a/src/lib/rpc/configure.in b/src/lib/rpc/configure.in index 7e3170abf..404840649 100644 --- a/src/lib/rpc/configure.in +++ b/src/lib/rpc/configure.in @@ -81,44 +81,44 @@ fi AC_SUBST(GSSRPC__SYS_PARAM_H) AC_SUBST(GSSRPC__NETDB_H) -AC_CACHE_CHECK([for int32_t in sys/types.h], - [krb5_cv_header_sys_types_h_int32_t], +AC_CACHE_CHECK([for uint32_t in sys/types.h], + [krb5_cv_header_sys_types_h_uint32_t], [AC_TRY_COMPILE([#include ], - [int32_t i = 0;], - [krb5_cv_header_sys_types_h_int32_t=yes], - [krb5_cv_header_sys_types_h_int32_t=no])]) -AC_CACHE_CHECK([for int32_t in stdint.h], - [krb5_cv_header_stdint_h_int32_t], + [uint32_t i = 0;], + [krb5_cv_header_sys_types_h_uint32_t=yes], + [krb5_cv_header_sys_types_h_uint32_t=no])]) +AC_CACHE_CHECK([for uint32_t in stdint.h], + [krb5_cv_header_stdint_h_uint32_t], [AC_TRY_COMPILE([#include ], - [int32_t i = 0;], - [krb5_cv_header_stdint_h_int32_t=yes], - [krb5_cv_header_stdint_h_int32_t=no])]) -AC_CACHE_CHECK([for int32_t in inttypes.h], - [krb5_cv_header_inttypes_h_int32_t], + [uint32_t i = 0;], + [krb5_cv_header_stdint_h_uint32_t=yes], + [krb5_cv_header_stdint_h_uint32_t=no])]) +AC_CACHE_CHECK([for uint32_t in inttypes.h], + [krb5_cv_header_inttypes_h_uint32_t], [AC_TRY_COMPILE([#include ], - [int32_t i = 0;], - [krb5_cv_header_inttypes_h_int32_t=yes], - [krb5_cv_header_inttypes_h_int32_t=no])]) + [uint32_t i = 0;], + [krb5_cv_header_inttypes_h_uint32_t=yes], + [krb5_cv_header_inttypes_h_uint32_t=no])]) GSSRPC__STDINT_H='/* #include */' GSSRPC__INTTYPES_H='/* #include */' -GSSRPC__FAKE_INT32='/* #undef GSSRPC__FAKE_INT32 */' -if test $krb5_cv_header_sys_types_h_int32_t = yes; then +GSSRPC__FAKE_UINT32='/* #undef GSSRPC__FAKE_INT32 */' +if test $krb5_cv_header_sys_types_h_uint32_t = yes; then : # already included sys/types.h else - if test $krb5_cv_header_stdint_h_int32_t = yes; then + if test $krb5_cv_header_stdint_h_uint32_t = yes; then GSSRPC__STDINT_H='#include ' else - if test $krb5_cv_header_inttypes_h_int_32_t = yes; then + if test $krb5_cv_header_inttypes_h_uint32_t = yes; then GSSRPC__INTTYPES_H='#include ' else AC_MSG_WARN([can't find a fixed-width 32-bit type anywhere; faking it]) - GSSRPC__FAKE_INT32='#define GSSRPC__FAKE_INT32 1' + GSSRPC__FAKE_UINT32='#define GSSRPC__FAKE_UINT32 1' fi fi fi AC_SUBST(GSSRPC__STDINT_H) AC_SUBST(GSSRPC__INTTYPES_H) -AC_SUBST(GSSRPC__FAKE_INT32) +AC_SUBST(GSSRPC__FAKE_UINT32) AC_CACHE_CHECK([for BSD type aliases], [krb5_cv_type_bsdaliases], [AC_TRY_COMPILE( diff --git a/src/lib/rpc/types.hin b/src/lib/rpc/types.hin index 8c10b715a..ed612f1f5 100644 --- a/src/lib/rpc/types.hin +++ b/src/lib/rpc/types.hin @@ -58,8 +58,8 @@ */ @GSSRPC__STDINT_H@ @GSSRPC__INTTYPES_H@ -/* Define if there is no int32_t in system headers. */ -@GSSRPC__FAKE_INT32@ +/* Define if there is no uint32_t in system headers. */ +@GSSRPC__FAKE_UINT32@ #include @@ -80,12 +80,12 @@ GSSRPC__BEGIN_DECLS #endif /* - * If no int32_t in system headers, fake it by looking for a 32-bit + * If no uint32_t in system headers, fake it by looking for a 32-bit * two's-complement type. Yes, this stomps on POSIX namespace, but if * we get here, we're on a system that's far from being * POSIX-compliant anyway. */ -#if GSSRPC__FAKE_INT32 +#if GSSRPC__FAKE_UINT32 #if (UINT_MAX == 0xffffffffUL) && (INT_MAX == 0x7fffffffL) \ && (INT_MIN == -INT_MAX-1) typedef int int32_t; @@ -101,11 +101,11 @@ typedef unsigned long uint32_t; typedef short int32_t; typedef unsigned short uint32_t; #else -#error "Can't fake up int32_t." +#error "Can't fake up uint32_t." #endif #endif #endif -#endif /* GSSRPC__FAKE_INT32 */ +#endif /* GSSRPC__FAKE_UINT32 */ #if (LONG_MIN != -LONG_MAX-1) || (INT_MIN != -INT_MAX-1) \ || (SHRT_MIN != -SHRT_MAX-1) -- 2.26.2