Stop checking sizeof(type) at configure time.
authorKen Raeburn <raeburn@mit.edu>
Fri, 31 Mar 2006 01:55:36 +0000 (01:55 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 31 Mar 2006 01:55:36 +0000 (01:55 +0000)
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
src/lib/gssapi/configure.in
src/lib/gssapi/generic/ChangeLog
src/lib/gssapi/generic/Makefile.in
src/lib/gssapi/generic/gssapi.hin
src/lib/gssapi/generic/gssapiP_generic.h

index 61ec844c90e130e19be40ebe7a6c46782944a558..f6832517c7d6fc041288d44b727b004dd0f86bbf 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-30  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * configure.in: Use K5_AC_INIT instead of AC_INIT.
index eccc62815d1e7717329631b6b322e6a0ddd32524..73b475cd25a275c6dcef8ff53b0ef46fce74a36e 100644 (file)
@@ -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 <stdint.h>\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 <inttypes.h>\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 <xom.h>\n", 35);}'\'' < /dev/null'], [
        include_xom='echo "/* no xom.h */"'])
index 803ae6c527ae4cdf1d08d2327097ad5c2cd95ddb..6a58dd64e9a77ffc11736db55a8078c7e9020bbe 100644 (file)
@@ -1,5 +1,14 @@
 2006-03-30  Ken Raeburn  <raeburn@mit.edu>
 
+       * 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.
index 8e722893e438e001356b2a3ebfd715fc29989dc1..352a6f12b80b352e005ad0460d7243a70ad805e4 100644 (file)
@@ -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
index 83fe62bb1b56cff0e85b312e586fc3fa726f9cf2..37b79e807f14d1936afae297bc21c87436d9b431 100644 (file)
@@ -44,9 +44,6 @@ extern "C" {
 
 #if defined(_MSDOS) || defined(_WIN32)
 #include <win-mac.h>
-#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
 /*
index 0af65df1b549ecd3b558dc634dd025841991602d..8936b63f05f265ea51ec7c9d12cfe3116bff2599 100644 (file)
@@ -30,6 +30,7 @@
 #if defined(_WIN32)
 #include "k5-int.h"
 #else
+#include "autoconf.h"
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif