[patch] 64 bit types in bitypes.h

Tim Mooney mooney at dogbert.cc.ndsu.NoDak.edu
Wed Aug 22 05:43:45 EST 2001


[cc'ed to exports at crypto.com.  This patch contains no changes to cryptographic
routines, it only changes how the package's configure script works]

[I'm not subscribed to this list, please cc me on responses.  Thanks]

I noticed a minor configure problem in OpenSSH 2.9p2.  Basically, configure
will check sys/types.h for various "sized" prototypes, and then it separately
checks for int64_t and u_int64_t.  If it doesn't find the standard sized
types (int32, int16, etc) it falls back to checking sys/bitypes.h *but* it
doesn't check for the 64 bit types in there.  It should.

The patch below my sig addresses the problem.

Also, unless there's a good reason I'm not aware of, the newer inttypes.h
header file should also be checked, in the event that the typedefs aren't
available in either of the other header files (inttypes.h should probably
even be preferred to sys/bitypes.h).

Tim
-- 
Tim Mooney                              mooney at dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


diff -ur openssh-2.9p2.orig/configure.in openssh-2.9p2/configure.in
--- openssh-2.9p2.orig/configure.in	Mon May 28 12:21:44 2001
+++ openssh-2.9p2/configure.in	Thu Aug 16 15:01:04 2001
@@ -821,6 +821,49 @@
 	)
 fi

+# if we didn't find int64_t and u_int64_t in sys/types.h but there is
+# a sys/bitypes.h, check it too.
+if (test -z "$have_int64_t" && \
+           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
+then
+	AC_MSG_CHECKING([for int64_t in sys/bitypes.h])
+	AC_TRY_COMPILE(
+		[ #include <sys/bitypes.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)
+		AC_MSG_RESULT([yes])
+		have_int64_t=1
+	else
+		AC_MSG_RESULT([no])
+	fi
+fi
+
+if (test -z "$have_u_int64_t" && \
+           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
+then
+	AC_MSG_CHECKING([for u_int64_t in sys/bitypes.h])
+	AC_TRY_COMPILE(
+		[ #include <sys/bitypes.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)
+		AC_MSG_RESULT([yes])
+		have_u_int64_t=1
+	else
+		AC_MSG_RESULT([no])
+	fi
+fi
+
+# should also explicitly check for inttypes.h, and the various intXX_T
+# and u_intXX_t in there.
+
 if test -z "$have_u_intxx_t" ; then
 	AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
 		AC_TRY_COMPILE(




More information about the openssh-unix-dev mailing list