From: Kurt Zeilenga Date: Thu, 25 Nov 1999 17:45:21 +0000 (+0000) Subject: Use 'long' for LBER_INT_T. X-Git-Tag: UCDATA_2_4~165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c59d1a34db0f134306250e95d713d12e1c7d924d;p=openldap Use 'long' for LBER_INT_T. --- diff --git a/configure b/configure index 59a2699480..b7faf1042f 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # $OpenLDAP$ -# from OpenLDAP: pkg/ldap/configure.in,v 1.279 1999/11/17 01:26:55 kdz Exp +# from OpenLDAP: pkg/ldap/configure.in,v 1.280 1999/11/25 16:10:51 kdz Exp # Copyright 1998,1999 The OpenLDAP Foundation. All Rights Reserved. # @@ -14052,18 +14052,14 @@ EOF -if test "$ac_cv_sizeof_short" -lt 4 ; then - cat >> confdefs.h <<\EOF -#define LBER_INT_T long -EOF +if test "$ac_cv_sizeof_long" -lt 4 ; then + { echo "configure: error: sizeof(long) < 4" 1>&2; exit 1; } +fi -else - cat >> confdefs.h <<\EOF -#define LBER_INT_T short +cat >> confdefs.h <<\EOF +#define LBER_INT_T long EOF -fi - cat >> confdefs.h <<\EOF #define LBER_LEN_T long EOF @@ -14078,7 +14074,7 @@ EOF echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:14082: checking for 8-bit clean memcmp" >&5 +echo "configure:14078: checking for 8-bit clean memcmp" >&5 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14086,7 +14082,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -14114,12 +14110,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:14118: checking for strftime" >&5 +echo "configure:14114: checking for strftime" >&5 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -14165,7 +14161,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:14169: checking for strftime in -lintl" >&5 +echo "configure:14165: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14173,7 +14169,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14212,12 +14208,12 @@ fi echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6 -echo "configure:14216: checking for inet_aton()" >&5 +echo "configure:14212: checking for inet_aton()" >&5 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_func_inet_aton=yes else @@ -14261,12 +14257,12 @@ EOF echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6 -echo "configure:14265: checking for _spawnlp" >&5 +echo "configure:14261: checking for _spawnlp" >&5 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__spawnlp=yes" else @@ -14314,12 +14310,12 @@ fi echo $ac_n "checking for _snprintf""... $ac_c" 1>&6 -echo "configure:14318: checking for _snprintf" >&5 +echo "configure:14314: checking for _snprintf" >&5 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__snprintf=yes" else @@ -14369,12 +14365,12 @@ fi echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6 -echo "configure:14373: checking for _vsnprintf" >&5 +echo "configure:14369: checking for _vsnprintf" >&5 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__vsnprintf=yes" else @@ -14424,12 +14420,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:14428: checking for vprintf" >&5 +echo "configure:14424: checking for vprintf" >&5 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -14477,12 +14473,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:14481: checking for _doprnt" >&5 +echo "configure:14477: checking for _doprnt" >&5 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -14535,12 +14531,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in vsnprintf vsprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14539: checking for $ac_func" >&5 +echo "configure:14535: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14641,12 +14637,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14645: checking for $ac_func" >&5 +echo "configure:14641: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14698,12 +14694,12 @@ done for ac_func in getopt tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14702: checking for $ac_func" >&5 +echo "configure:14698: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14764,13 +14760,13 @@ fi # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:14768: checking declaration of sys_errlist" >&5 +echo "configure:14764: checking declaration of sys_errlist" >&5 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -14783,7 +14779,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:14787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes ol_cv_have_sys_errlist=yes @@ -14806,20 +14802,20 @@ EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:14810: checking existence of sys_errlist" >&5 +echo "configure:14806: checking existence of sys_errlist" >&5 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:14823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index b80a63b444..cf0379d18e 100644 --- a/configure.in +++ b/configure.in @@ -1943,12 +1943,11 @@ AC_COMPILE_CHECK_SIZEOF(short) AC_COMPILE_CHECK_SIZEOF(int) AC_COMPILE_CHECK_SIZEOF(long) -if test "$ac_cv_sizeof_short" -lt 4 ; then - AC_DEFINE(LBER_INT_T,long) -else - AC_DEFINE(LBER_INT_T,short) +if test "$ac_cv_sizeof_long" -lt 4 ; then + AC_MSG_ERROR([sizeof(long) < 4]) fi +AC_DEFINE(LBER_INT_T,long) AC_DEFINE(LBER_LEN_T,long) AC_DEFINE(LBER_SOCKET_T,int) AC_DEFINE(LBER_TAG_T,long) diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index d932791e5e..a643270e78 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -27,30 +27,12 @@ LDAP_BEGIN_DECL extern BER_ERRNO_FN ber_int_errno_fn; /* these have to match lber types settings */ -#if LBER_INT_T == short -# define LBER_INT_HTON(i) AC_HTONS(i) -# define LBER_INT_NTOH(i) AC_NTOHS(i) -#else -# define LBER_INT_HTON(i) AC_HTONL(i) -# define LBER_INT_NTOH(i) AC_NTOHL(i) -#endif - -#if LBER_LEN_T == short -# define LBER_LEN_HTON(l) AC_HTONS(l) -# define LBER_LEN_NTOH(l) AC_NTOHS(l) -#else -# define LBER_LEN_HTON(l) AC_HTONL(l) -# define LBER_LEN_NTOH(l) AC_NTOHL(l) -#endif - -#if LBER_TAG_T == short -# define LBER_TAG_HTON(t) AC_HTONS(t) -# define LBER_TAG_NTOH(t) AC_NTOHS(t) -#else -# define LBER_TAG_HTON(t) AC_HTONL(t) -# define LBER_TAG_NTOH(t) AC_NTOHL(t) -#endif - +#define LBER_INT_HTON(i) AC_HTONL(i) +#define LBER_INT_NTOH(i) AC_NTOHL(i) +#define LBER_LEN_HTON(l) AC_HTONL(l) +#define LBER_LEN_NTOH(l) AC_NTOHL(l) +#define LBER_TAG_HTON(t) AC_HTONL(t) +#define LBER_TAG_NTOH(t) AC_NTOHL(t) struct lber_options { short lbo_valid;