summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--acconfig.h2
-rw-r--r--configure.in26
-rw-r--r--defines.h41
-rw-r--r--loginrec.c3
5 files changed, 53 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index ef8407e1..9adb880d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
- (djm) Fix address logging in utmp from Kevin Steves
<stevesk@sweden.hp.com>
- (djm) Redhat spec and manpage fixes from Pekka Savola <pekkas@netcore.fi>
+ - (djm) Seperate tests for int64_t and u_int64_t types
20000920
- (djm) Fix bad path substitution. Report from Andrew Miner
diff --git a/acconfig.h b/acconfig.h
index e129ef33..1b860d66 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -207,6 +207,8 @@
#undef HAVE_INTXX_T
#undef HAVE_U_INTXX_T
#undef HAVE_UINTXX_T
+#undef HAVE_INT64_T
+#undef HAVE_U_INT64_T
#undef HAVE_SOCKLEN_T
#undef HAVE_SIZE_T
#undef HAVE_SSIZE_T
diff --git a/configure.in b/configure.in
index 774529d3..305d9a49 100644
--- a/configure.in
+++ b/configure.in
@@ -487,6 +487,19 @@ if test "x$ac_cv_have_intxx_t" = "xyes" ; then
have_intxx_t=1
fi
+AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
+ AC_TRY_COMPILE(
+ [ #include <sys/types.h> ],
+ [ int64_t a; a = 1;],
+ [ ac_cv_have_int64_t="yes" ],
+ [ ac_cv_have_int64_t="no" ]
+ )
+])
+if test "x$ac_cv_have_int64_t" = "xyes" ; then
+ AC_DEFINE(HAVE_INT64_T)
+ have_int64_t=1
+fi
+
AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
@@ -500,6 +513,19 @@ if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
have_u_intxx_t=1
fi
+AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
+ AC_TRY_COMPILE(
+ [ #include <sys/types.h> ],
+ [ u_int64_t a; a = 1;],
+ [ ac_cv_have_u_int64_t="yes" ],
+ [ ac_cv_have_u_int64_t="no" ]
+ )
+])
+if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
+ AC_DEFINE(HAVE_U_INT64_T)
+ have_u_int64_t=1
+fi
+
if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
test "x$ac_cv_header_sys_bitypes_h" = "xyes")
then
diff --git a/defines.h b/defines.h
index 0ac3e96b..cf2a3429 100644
--- a/defines.h
+++ b/defines.h
@@ -123,16 +123,6 @@ typedef int int32_t;
# else
# error "32 bit int type not found."
# endif
-# if (SIZEOF_LONG_INT == 8)
-typedef long int int64_t;
-# else
-# if (SIZEOF_LONG_LONG_INT == 8)
-typedef long long int int64_t;
-# define HAVE_INTXX_T 1
-# else
-# error "64 bit int type not found."
-# endif
-# endif
#endif
/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
@@ -141,7 +131,6 @@ typedef long long int int64_t;
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
-typedef uint64_t u_int64_t;
# define HAVE_U_INTXX_T 1
# else
# if (SIZEOF_CHAR == 1)
@@ -159,15 +148,31 @@ typedef unsigned int u_int32_t;
# else
# error "32 bit int type not found."
# endif
-# if (SIZEOF_LONG_INT == 8)
-typedef unsigned long int u_int64_t;
+# endif
+#endif
+
+/* 64-bit types */
+#ifndef HAVE_INT64_T
+# if (SIZEOF_LONG_INT == 8)
+typedef long int int64_t;
+# else
+# if (SIZEOF_LONG_LONG_INT == 8)
+typedef long long int int64_t;
+# define HAVE_INTXX_T 1
# else
-# if (SIZEOF_LONG_LONG_INT == 8)
+# error "64 bit int type not found."
+# endif
+# endif
+#endif
+#ifndef HAVE_U_INT64_T
+# if (SIZEOF_LONG_INT == 8)
+typedef unsigned long int u_int64_t;
+# else
+# if (SIZEOF_LONG_LONG_INT == 8)
typedef unsigned long long int u_int64_t;
-# define HAVE_U_INTXX_T 1
-# else
-# error "64 bit int type not found."
-# endif
+# define HAVE_U_INTXX_T 1
+# else
+# error "64 bit int type not found."
# endif
# endif
#endif
diff --git a/loginrec.c b/loginrec.c
index 460f551b..22c2be1e 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -161,7 +161,7 @@
#include "xmalloc.h"
#include "loginrec.h"
-RCSID("$Id: loginrec.c,v 1.24 2000/09/23 02:57:27 djm Exp $");
+RCSID("$Id: loginrec.c,v 1.25 2000/09/23 03:12:25 djm Exp $");
/**
** prototypes for helper functions in this file
@@ -681,7 +681,6 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
/* this is just a 32-bit IP address */
if (li->hostaddr.sa.sa_family == AF_INET)
utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr;
- # endif
# endif
# ifdef HAVE_SYSLEN_IN_UTMPX
/* ut_syslen is the length of the utx_host string */