Module Name:    src
Committed By:   maya
Date:           Mon Jun 11 18:48:25 UTC 2018

Modified Files:
        src/tools/compat: compat_defs.h configure configure.ac
            nbtool_config.h.in

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.88 -r1.89 src/tools/compat/configure
cvs rdiff -u -r1.89 -r1.90 src/tools/compat/configure.ac
cvs rdiff -u -r1.42 -r1.43 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.109 src/tools/compat/compat_defs.h:1.110
--- src/tools/compat/compat_defs.h:1.109	Tue Oct  3 01:43:03 2017
+++ src/tools/compat/compat_defs.h	Mon Jun 11 18:48:24 2018
@@ -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 @@ __GEN_ENDIAN_DEC(64, le)
 #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

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.88 src/tools/compat/configure:1.89
--- src/tools/compat/configure:1.88	Sat Dec  9 04:23:22 2017
+++ src/tools/compat/configure	Mon Jun 11 18:48:25 2018
@@ -4227,6 +4227,17 @@ _ACEOF
 
 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>

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.89 src/tools/compat/configure.ac:1.90
--- src/tools/compat/configure.ac:1.89	Sat Dec  9 04:22:53 2017
+++ src/tools/compat/configure.ac	Mon Jun 11 18:48:25 2018
@@ -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 @@ AC_CHECK_HEADERS(rpc/types.h netconfig.h
 # 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>

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.42 src/tools/compat/nbtool_config.h.in:1.43
--- src/tools/compat/nbtool_config.h.in:1.42	Sat Dec  9 04:23:22 2017
+++ src/tools/compat/nbtool_config.h.in	Mon Jun 11 18:48:25 2018
@@ -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
 

Reply via email to