Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/compat Add configure check and fallback definition for...



details:   https://anonhg.NetBSD.org/src/rev/c17d10c6431b
branches:  trunk
changeset: 319786:c17d10c6431b
user:      maya <maya%NetBSD.org@localhost>
date:      Mon Jun 11 18:48:24 2018 +0000

description:
Add configure check and fallback definition for u_longlong_t

Should help linux tools compilation of dtrace tools, and not
affect NetBSD.

>From Chuck Zmudzinski in current-users, with light modification
by myself.

diffstat:

 tools/compat/compat_defs.h      |   6 +++++-
 tools/compat/configure          |  11 +++++++++++
 tools/compat/configure.ac       |   3 ++-
 tools/compat/nbtool_config.h.in |   5 ++++-
 4 files changed, 22 insertions(+), 3 deletions(-)

diffs (79 lines):

diff -r ea717184fd22 -r c17d10c6431b tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Mon Jun 11 18:03:38 2018 +0000
+++ b/tools/compat/compat_defs.h        Mon Jun 11 18:48:24 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.109 2017/10/03 01:43:03 christos Exp $       */
+/*     $NetBSD: compat_defs.h,v 1.110 2018/06/11 18:48:24 maya Exp $   */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -1298,6 +1298,10 @@
 #define NBBY 8
 #endif
 
+#if !HAVE_U_LONGLONG_T
+typedef uint64_t u_longlong_t;
+#endif
+
 #if !HAVE_U_QUAD_T
 /* #define, not typedef, as quad_t exists as a struct on some systems */
 #define quad_t long long
diff -r ea717184fd22 -r c17d10c6431b tools/compat/configure
--- a/tools/compat/configure    Mon Jun 11 18:03:38 2018 +0000
+++ b/tools/compat/configure    Mon Jun 11 18:48:24 2018 +0000
@@ -4227,6 +4227,17 @@
 
 fi
 
+ac_fn_c_check_type "$LINENO" "u_longlong_t" "ac_cv_type_u_longlong_t" "#include <sys/types.h>
+"
+if test "x$ac_cv_type_u_longlong_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U_LONGLONG_T 1
+_ACEOF
+
+
+fi
+
 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
 #ifdef HAVE_RPC_TYPES_H
 #include <rpc/types.h>
diff -r ea717184fd22 -r c17d10c6431b tools/compat/configure.ac
--- a/tools/compat/configure.ac Mon Jun 11 18:03:38 2018 +0000
+++ b/tools/compat/configure.ac Mon Jun 11 18:48:24 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.89 2017/12/09 04:22:53 sevan Exp $
+#      $NetBSD: configure.ac,v 1.90 2018/06/11 18:48:25 maya Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -97,6 +97,7 @@
 # Typedefs.
 AC_TYPE_SIZE_T
 AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t])
+AC_CHECK_TYPES([u_longlong_t],,, [#include <sys/types.h>])
 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1,
                          [Define if you have the socklen_t type.])],,
 [#include <sys/types.h>
diff -r ea717184fd22 -r c17d10c6431b tools/compat/nbtool_config.h.in
--- a/tools/compat/nbtool_config.h.in   Mon Jun 11 18:03:38 2018 +0000
+++ b/tools/compat/nbtool_config.h.in   Mon Jun 11 18:48:24 2018 +0000
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*      $NetBSD: nbtool_config.h.in,v 1.42 2017/12/09 04:23:22 sevan Exp $    */
+/*      $NetBSD: nbtool_config.h.in,v 1.43 2018/06/11 18:48:25 maya Exp $    */
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -780,6 +780,9 @@
 /* Define to 1 if the system has the type `u_long'. */
 #undef HAVE_U_LONG
 
+/* Define to 1 if the system has the type `u_longlong_t'. */
+#undef HAVE_U_LONGLONG_T
+
 /* Define to 1 if the system has the type `u_quad_t'. */
 #undef HAVE_U_QUAD_T
 



Home | Main Index | Thread Index | Old Index