From 3ac99d0c7c5aed4a1064c1279d99430a66e0565e Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 31 Mar 2006 01:55:36 +0000 Subject: [PATCH] Stop checking sizeof(type) at configure time. Pull stdint.h and inttypes.h into gssapi.h if available. Don't use size/limit tests for choosing gss_[u]int32; just use [u]int32_t. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17813 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/ChangeLog | 5 +++++ src/lib/gssapi/configure.in | 7 ++++--- src/lib/gssapi/generic/ChangeLog | 9 +++++++++ src/lib/gssapi/generic/Makefile.in | 10 +++++++--- src/lib/gssapi/generic/gssapi.hin | 15 ++------------- src/lib/gssapi/generic/gssapiP_generic.h | 1 + 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/lib/gssapi/ChangeLog b/src/lib/gssapi/ChangeLog index 61ec844c9..f6832517c 100644 --- a/src/lib/gssapi/ChangeLog +++ b/src/lib/gssapi/ChangeLog @@ -1,3 +1,8 @@ +2006-03-30 Ken Raeburn + + * configure.in: Check for inttypes.h and handle it like xom.h and + stdint.h. Don't check sizes of any types. + 2005-08-20 Ken Raeburn * configure.in: Use K5_AC_INIT instead of AC_INIT. diff --git a/src/lib/gssapi/configure.in b/src/lib/gssapi/configure.in index eccc62815..73b475cd2 100644 --- a/src/lib/gssapi/configure.in +++ b/src/lib/gssapi/configure.in @@ -3,13 +3,14 @@ CONFIG_RULES AC_PROG_AWK AC_CHECK_HEADERS(stdlib.h sys/types.h limits.h memory.h) AC_TYPE_SIZE_T -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(long) AC_CHECK_HEADER(stdint.h,[ include_stdint='awk '\''END{printf("%cinclude \n", 35);}'\'' < /dev/null'], include_stdint='echo "/* no stdint.h */"') AC_SUBST(include_stdint) +AC_CHECK_HEADER(inttypes.h,[ + include_inttypes='awk '\''END{printf("%cinclude \n", 35);}'\'' < /dev/null'], + include_inttypes='echo "/* no inttypes.h */"') +AC_SUBST(include_inttypes) AC_CHECK_HEADER(xom.h,[ include_xom='awk '\''END{printf("%cinclude \n", 35);}'\'' < /dev/null'], [ include_xom='echo "/* no xom.h */"']) diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index 803ae6c52..6a58dd64e 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,5 +1,14 @@ 2006-03-30 Ken Raeburn + * gssapiP_generic.h [!_WIN32]: Include autoconf.h. + + * Makefile.in (include_stdint, include_inttypes): New make + macros. + (gssapi.h): Use them. Don't pull SIZEOF_ macros from autoconf.h. + + * gssapi.hin (gss_uint32, gss_int32): Define as uint32_t and + int32_t, respectively. + * util_token.c: Include limits.h. (der_length_size, der_write_length): Test INT_MAX instead of SIZEOF_INT. diff --git a/src/lib/gssapi/generic/Makefile.in b/src/lib/gssapi/generic/Makefile.in index 8e722893e..352a6f12b 100644 --- a/src/lib/gssapi/generic/Makefile.in +++ b/src/lib/gssapi/generic/Makefile.in @@ -37,15 +37,19 @@ $(OUTPRE)gssapi_err_generic.$(OBJEXT): gssapi_err_generic.c gssapi_err_generic.h: gssapi_err_generic.et gssapi_err_generic.c: gssapi_err_generic.et +include_stdint=@include_stdint@ +include_inttypes=@include_inttypes@ include_xom=@include_xom@ +##DOS##include_stdint=rem +##DOS##include_inttypes=rem ##DOS##include_xom=rem gssapi.h: gssapi.hin $(BUILDTOP)/include/autoconf.h @echo "Creating gssapi.h" ; \ h=gss$$$$; $(RM) $$h; \ (echo "/* This is the gssapi.h prologue. */"; \ - echo "/* It contains some choice pieces of autoconf.h */"; \ - sed -n "/SIZEOF/s//GSS_&/p" < $(BUILDTOP)/include/autoconf.h && \ - $(include_xom)&& \ + $(include_stdint) && \ + $(include_inttypes) && \ + $(include_xom) && \ echo "/* End of gssapi.h prologue. */"&& \ cat $(srcdir)/gssapi.hin )> $$h && \ (set -x; $(MV) $$h $@) ; e=$$?; $(RM) $$h; exit $$e diff --git a/src/lib/gssapi/generic/gssapi.hin b/src/lib/gssapi/generic/gssapi.hin index 83fe62bb1..37b79e807 100644 --- a/src/lib/gssapi/generic/gssapi.hin +++ b/src/lib/gssapi/generic/gssapi.hin @@ -44,9 +44,6 @@ extern "C" { #if defined(_MSDOS) || defined(_WIN32) #include -#define GSS_SIZEOF_SHORT SIZEOF_SHORT -#define GSS_SIZEOF_LONG SIZEOF_LONG -#define GSS_SIZEOF_INT SIZEOF_INT #endif #ifndef KRB5_CALLCONV @@ -80,16 +77,8 @@ typedef void * gss_ctx_id_t; * The following type must be defined as the smallest natural unsigned integer * supported by the platform that has at least 32 bits of precision. */ -#if (GSS_SIZEOF_SHORT == 4) -typedef unsigned short gss_uint32; -typedef short gss_int32; -#elif (GSS_SIZEOF_INT == 4) -typedef unsigned int gss_uint32; -typedef int gss_int32; -#elif (GSS_SIZEOF_LONG == 4) -typedef unsigned long gss_uint32; -typedef long gss_int32; -#endif +typedef uint32_t gss_uint32; +typedef int32_t gss_int32; #ifdef OM_STRING /* diff --git a/src/lib/gssapi/generic/gssapiP_generic.h b/src/lib/gssapi/generic/gssapiP_generic.h index 0af65df1b..8936b63f0 100644 --- a/src/lib/gssapi/generic/gssapiP_generic.h +++ b/src/lib/gssapi/generic/gssapiP_generic.h @@ -30,6 +30,7 @@ #if defined(_WIN32) #include "k5-int.h" #else +#include "autoconf.h" #ifdef HAVE_STDLIB_H #include #endif -- 2.26.2