From edfc0428847f489e67c5672c1240560ef7b24212 Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Wed, 28 Mar 2007 20:11:29 +0000 Subject: [PATCH] Stupid portability bug: types where computed from the machine type, not by using autoconf tests (ICP failed on UltraSparc) --- SRC/configure.ac | 4 ++++ SRC/icp.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/SRC/configure.ac b/SRC/configure.ac index 25599b6..76c5a0f 100644 --- a/SRC/configure.ac +++ b/SRC/configure.ac @@ -174,6 +174,10 @@ AC_CHECK_FUNCS(dlopen, , [AC_CHECK_LIB(dl,dlopen, , [AC_MSG_ERROR([echoping requires dlopen (dynamic loading of libraries) for plugins])])]) +dnl Checking size of ints, we often need it for binary protocols like ICP +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) + if test "$LIBIDN" = "1"; then CF_LIB_LIBIDN fi diff --git a/SRC/icp.h b/SRC/icp.h index bfdf726..9528459 100644 --- a/SRC/icp.h +++ b/SRC/icp.h @@ -11,10 +11,12 @@ #define ICP_FLAG_HIT_OBJ 0x80000000ul #define ICP_FLAG_SRC_RTT 0x40000000ul -#ifdef __alpha__ +#if SIZEOF_INT == 4 typedef unsigned int u_num32; -#else +#elif SIZEOF_LONG == 4 typedef unsigned long u_num32; +#else +#error "No suitable type for representing a 32-bits value" #endif struct icp_common_s {