From 566cab9427e5d6ce8bdff82d911ec76662ca7927 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 10 Jun 1997 21:32:47 +0000 Subject: Guarantee that we can deduce a 32-bit type. svn path=/trunk/; revision=1079 --- acconfig.h | 5 +++++ configure.in | 4 ++++ imap.c | 12 ++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/acconfig.h b/acconfig.h index 21a38dfa..d416b9a7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -41,6 +41,11 @@ /* Define if you have atexit */ #undef HAVE_ATEXIT +/* Define to help us deduce a 32-bit type (required for Kerberos) */ +#undef SIZEOF_INT +#undef SIZEOF_SHORT +#undef SIZEOF_LONG + /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: diff --git a/configure.in b/configure.in index 46e6214c..4398fa4c 100644 --- a/configure.in +++ b/configure.in @@ -127,6 +127,10 @@ AC_TRY_LINK([#include [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) + AC_OUTPUT(Makefile, [ # Makefile uses this timestamp file to know when to remake Makefile, # build.sh, and glob/Makefile. diff --git a/imap.c b/imap.c index a593039f..276cf46d 100644 --- a/imap.c +++ b/imap.c @@ -95,7 +95,15 @@ int imap_ok (int sock, char *argbuf) } #ifdef KERBEROS_V4 -#include +#if SIZEOF_INT = 4 +typedef int32 int; +#elif SIZEOF_SHORT = 4 +typedef int32 short; +#elif SIZEOF_LONG = 4 +typedef int32 long; +#else +#error Cannot deduce a 32-bit-type +#endif static int do_rfc1731(int sock, struct query *ctl, char *buf) /* authenticate as per RFC1731 -- note 32-bit integer requirement here */ @@ -103,7 +111,7 @@ static int do_rfc1731(int sock, struct query *ctl, char *buf) int result = 0, len; char buf1[4096], buf2[4096]; union { - u_int32_t cint; + int32 cint; char cstr[4]; } challenge1, challenge2; char srvinst[INST_SZ]; -- cgit v1.2.3