Source-Changes-HG archive

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

[src/trunk]: src/tools/compat handle __fpurge being declared in <stdio_ext.h>



details:   https://anonhg.NetBSD.org/src/rev/91edc4d4b6f4
branches:  trunk
changeset: 826862:91edc4d4b6f4
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 02 22:19:45 2017 +0000

description:
handle __fpurge being declared in <stdio_ext.h>

diffstat:

 tools/compat/compat_defs.h |  6 +++++-
 tools/compat/configure.ac  |  8 ++++----
 tools/compat/fpurge.c      |  5 ++++-
 3 files changed, 13 insertions(+), 6 deletions(-)

diffs (68 lines):

diff -r 88dfe9c189fb -r 91edc4d4b6f4 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Mon Oct 02 22:14:32 2017 +0000
+++ b/tools/compat/compat_defs.h        Mon Oct 02 22:19:45 2017 +0000
@@ -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.108 2017/10/02 22:19:45 christos Exp $       */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -252,6 +252,10 @@
 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)
diff -r 88dfe9c189fb -r 91edc4d4b6f4 tools/compat/configure.ac
--- a/tools/compat/configure.ac Mon Oct 02 22:14:32 2017 +0000
+++ b/tools/compat/configure.ac Mon Oct 02 22:19:45 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.87 2017/01/07 21:30:42 christos Exp $
+#      $NetBSD: configure.ac,v 1.88 2017/10/02 22:19:45 christos Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -78,7 +78,7 @@
 
 # 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 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, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln,
+       fpurge, getdelim, getline, snprintf],,, [
 #include <stdio.h>
 ])
 
diff -r 88dfe9c189fb -r 91edc4d4b6f4 tools/compat/fpurge.c
--- a/tools/compat/fpurge.c     Mon Oct 02 22:14:32 2017 +0000
+++ b/tools/compat/fpurge.c     Mon Oct 02 22:19:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $      */
+/*     $NetBSD: fpurge.c,v 1.2 2017/10/02 22:19:45 christos 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>
 



Home | Main Index | Thread Index | Old Index