Don't use 'int' for LBER_*_T types as we only have hton{s,l}.

Select appropriopriate hton{s,l} function to use in lber-int.h.
This commit is contained in:
Kurt Zeilenga 1999-11-25 17:10:45 +00:00
parent e9a246744e
commit 62a06eda3e
4 changed files with 554 additions and 591 deletions

1103
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -708,7 +708,6 @@ AC_CHECK_FUNC(socket, :, [
dnl hopefully we won't include too many libraries dnl hopefully we won't include too many libraries
AC_CHECK_LIB(socket, main) AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(net, main) AC_CHECK_LIB(net, main)
AC_CHECK_LIB(net, socket)
AC_CHECK_LIB(nsl_s, main) AC_CHECK_LIB(nsl_s, main)
AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(inet, socket) AC_CHECK_LIB(inet, socket)
@ -717,7 +716,6 @@ dnl hopefully we won't include too many libraries
dnl require select dnl require select
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.])) AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
dnl AC_CHECK_FUNCS(socketpair)
if test "${ac_cv_header_winsock_h}" != yes; then if test "${ac_cv_header_winsock_h}" != yes; then
dnl Select arg types dnl Select arg types
@ -1945,12 +1943,10 @@ AC_COMPILE_CHECK_SIZEOF(short)
AC_COMPILE_CHECK_SIZEOF(int) AC_COMPILE_CHECK_SIZEOF(int)
AC_COMPILE_CHECK_SIZEOF(long) AC_COMPILE_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_int" -lt 4 ; then if test "$ac_cv_sizeof_short" -lt 4 ; then
AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
AC_DEFINE(LBER_INT_T,long) AC_DEFINE(LBER_INT_T,long)
else else
AC_DEFINE(LBER_INT_T,int) AC_DEFINE(LBER_INT_T,short)
fi fi
AC_DEFINE(LBER_LEN_T,long) AC_DEFINE(LBER_LEN_T,long)

View file

@ -35,7 +35,7 @@ LDAP_BEGIN_DECL
*/ */
/* LBER boolean, enum, integers - 32 bits or larger*/ /* LBER boolean, enum, integers - 32 bits or larger*/
#define LBER_INT_T int #define LBER_INT_T long
/* LBER tags - 32 bits or larger */ /* LBER tags - 32 bits or larger */
#define LBER_TAG_T long #define LBER_TAG_T long
@ -44,7 +44,7 @@ LDAP_BEGIN_DECL
#define LBER_SOCKET_T unsigned int #define LBER_SOCKET_T unsigned int
/* LBER lengths - 32 bits or larger*/ /* LBER lengths - 32 bits or larger*/
#define LBER_LEN_T int #define LBER_LEN_T long
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View file

@ -26,14 +26,30 @@ LDAP_BEGIN_DECL
extern BER_ERRNO_FN ber_int_errno_fn; extern BER_ERRNO_FN ber_int_errno_fn;
/* these have to match lber types settings */ /* 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_HTON(i) AC_HTONL(i)
# define LBER_INT_NTOH(i) AC_NTOHL(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_HTON(l) AC_HTONL(l)
# define LBER_LEN_NTOH(l) AC_NTOHL(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_HTON(t) AC_HTONL(t)
# define LBER_TAG_NTOH(t) AC_NTOHL(t) # define LBER_TAG_NTOH(t) AC_NTOHL(t)
#endif
struct lber_options { struct lber_options {