Module Name: src
Committed By: snj
Date: Thu Dec 21 19:11:21 UTC 2017
Modified Files:
src/tools/compat [netbsd-8]: compat_defs.h configure configure.ac
fpurge.c nbtool_config.h.in
Log Message:
Pull up following revision(s) (requested by sevan in ticket #435):
tools/compat/compat_defs.h: 1.108
tools/compat/configure: 1.87-1.88
tools/compat/configure.ac: 1.88-1.89
tools/compat/fpurge.c: 1.2
tools/compat/nbtool_config.h.in: 1.41-1.42
handle __fpurge being declared in <stdio_ext.h>
--
regen
--
Add asnprintf() to the AC_CHECK_DECLS list.
Resolves conflict when cross compiling on Cygwin the provided implementation
does not get picked up.
Closes PR toolchain/52797
--
regen
To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.6.1 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.86 -r1.86.6.1 src/tools/compat/configure
cvs rdiff -u -r1.87 -r1.87.6.1 src/tools/compat/configure.ac
cvs rdiff -u -r1.1 -r1.1.38.1 src/tools/compat/fpurge.c
cvs rdiff -u -r1.40 -r1.40.6.1 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.107 src/tools/compat/compat_defs.h:1.107.6.1
--- src/tools/compat/compat_defs.h:1.107 Sat Jan 7 21:29:30 2017
+++ src/tools/compat/compat_defs.h Thu Dec 21 19:11:21 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_defs.h,v 1.107 2017/01/07 21:29:30 christos Exp $ */
+/* $NetBSD: compat_defs.h,v 1.107.6.1 2017/12/21 19:11:21 snj Exp $ */
#ifndef __NETBSD_COMPAT_DEFS_H__
#define __NETBSD_COMPAT_DEFS_H__
@@ -252,6 +252,10 @@ extern int optind, opterr, optopt;
char *dirname(char *);
#endif
+#if !HAVE_DECL_FPURGE
+void fpurge(FILE *);
+#endif
+
#if !HAVE_DIRFD
#if HAVE_DIR_DD_FD
#define dirfd(dirp) ((dirp)->dd_fd)
Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.86 src/tools/compat/configure:1.86.6.1
--- src/tools/compat/configure:1.86 Sat Jan 7 21:31:07 2017
+++ src/tools/compat/configure Thu Dec 21 19:11:21 2017
@@ -4097,7 +4097,7 @@ fi
fi
-for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h \
+for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4520,6 +4520,19 @@ fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_ASPRINTF $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "asnprintf" "ac_cv_have_decl_asnprintf" "
+#include <stdio.h>
+
+"
+if test "x$ac_cv_have_decl_asnprintf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ASNPRINTF $ac_have_decl
+_ACEOF
ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "
#include <stdio.h>
@@ -4572,19 +4585,44 @@ fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_FGETLN $ac_have_decl
_ACEOF
-ac_fn_c_check_decl "$LINENO" "fparseln
- getdelim" "ac_cv_have_decl_fparseln__getdelim" "
+ac_fn_c_check_decl "$LINENO" "fparseln" "ac_cv_have_decl_fparseln" "
+#include <stdio.h>
+
+"
+if test "x$ac_cv_have_decl_fparseln" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPARSELN $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "
+#include <stdio.h>
+
+"
+if test "x$ac_cv_have_decl_fpurge" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPURGE $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "
#include <stdio.h>
"
-if test "x$ac_cv_have_decl_fparseln__getdelim" = xyes; then :
+if test "x$ac_cv_have_decl_getdelim" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FPARSELN__GETDELIM $ac_have_decl
+#define HAVE_DECL_GETDELIM $ac_have_decl
_ACEOF
ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "
#include <stdio.h>
Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.87 src/tools/compat/configure.ac:1.87.6.1
--- src/tools/compat/configure.ac:1.87 Sat Jan 7 21:30:42 2017
+++ src/tools/compat/configure.ac Thu Dec 21 19:11:21 2017
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.87 2017/01/07 21:30:42 christos Exp $
+# $NetBSD: configure.ac,v 1.87.6.1 2017/12/21 19:11:21 snj Exp $
#
# Autoconf definition file for libnbcompat.
#
@@ -78,7 +78,7 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h
# Find headers that may not be available.
AC_HEADER_DIRENT
-AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \
+AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h)
AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \
sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \
@@ -140,8 +140,8 @@ AC_CHECK_MEMBERS(struct statvfs.f_iosize
AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
# Global variable decls.
-AC_CHECK_DECLS([asprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln
- getdelim, getline, snprintf],,, [
+AC_CHECK_DECLS([asprintf, asnprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln,
+ fpurge, getdelim, getline, snprintf],,, [
#include <stdio.h>
])
Index: src/tools/compat/fpurge.c
diff -u src/tools/compat/fpurge.c:1.1 src/tools/compat/fpurge.c:1.1.38.1
--- src/tools/compat/fpurge.c:1.1 Tue Jun 16 22:35:34 2009
+++ src/tools/compat/fpurge.c Thu Dec 21 19:11:21 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $ */
+/* $NetBSD: fpurge.c,v 1.1.38.1 2017/12/21 19:11:21 snj Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,6 +36,9 @@
#include "nbtool_config.h"
#if !HAVE_FPURGE
+#if HAVE_STDIO_EXT_H
+#include <stdio_ext.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.40 src/tools/compat/nbtool_config.h.in:1.40.6.1
--- src/tools/compat/nbtool_config.h.in:1.40 Sat Jan 7 21:31:07 2017
+++ src/tools/compat/nbtool_config.h.in Thu Dec 21 19:11:21 2017
@@ -1,6 +1,6 @@
/* nbtool_config.h.in. Generated from configure.ac by autoheader. */
-/* $NetBSD: nbtool_config.h.in,v 1.40 2017/01/07 21:31:07 christos Exp $ */
+/* $NetBSD: nbtool_config.h.in,v 1.40.6.1 2017/12/21 19:11:21 snj Exp $ */
#ifndef __NETBSD_NBTOOL_CONFIG_H__
#define __NETBSD_NBTOOL_CONFIG_H__
@@ -47,6 +47,10 @@
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
+/* Define to 1 if you have the declaration of `asnprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ASNPRINTF
+
/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
don't. */
#undef HAVE_DECL_ASPRINTF
@@ -126,14 +130,22 @@
*/
#undef HAVE_DECL_FGETLN
-/* Define to 1 if you have the declaration of `fparseln getdelim', and to 0 if
- you don't. */
-#undef HAVE_DECL_FPARSELN__GETDELIM
+/* Define to 1 if you have the declaration of `fparseln', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FPARSELN
+
+/* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FPURGE
/* Define to 1 if you have the declaration of `fstatvfs', and to 0 if you
don't. */
#undef HAVE_DECL_FSTATVFS
+/* Define to 1 if you have the declaration of `getdelim', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETDELIM
+
/* Define to 1 if you have the declaration of `getline', and to 0 if you
don't. */
#undef HAVE_DECL_GETLINE
@@ -613,6 +625,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio_ext.h> header file. */
+#undef HAVE_STDIO_EXT_H
+
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H