summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-09-11 21:11:58 +0200
committerBruno Haible <bruno@clisp.org>2011-09-11 21:11:58 +0200
commit28d57000306f68f4ef8f0ada970c5733f9ed99f4 (patch)
tree892d9bbb7e9ac01e84bc32fb216aa38a58c18580
parent2210a2b11c43222262e65d7200bb094dc6d052d3 (diff)
downloadgnulib-28d57000306f68f4ef8f0ada970c5733f9ed99f4.tar.gz
dirent: Don't assume <dirent.h> exists.
* lib/dirent.in.h: Include <dirent.h> only if HAVE_DIRENT_H is 1. * m4/dirent_h.m4 (gl_DIRENT_H): Set HAVE_DIRENT_H. * modules/dirent (Makefile.am): Substitute HAVE_DIRENT_H. * doc/posix-headers/dirent.texi: Mention the MSVC problem.
-rw-r--r--ChangeLog8
-rw-r--r--doc/posix-headers/dirent.texi3
-rw-r--r--lib/dirent.in.h4
-rw-r--r--m4/dirent_h.m48
-rw-r--r--modules/dirent1
5 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f5725ae6d..f6987e2e06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2011-09-11 Bruno Haible <bruno@clisp.org>
+ dirent: Don't assume <dirent.h> exists.
+ * lib/dirent.in.h: Include <dirent.h> only if HAVE_DIRENT_H is 1.
+ * m4/dirent_h.m4 (gl_DIRENT_H): Set HAVE_DIRENT_H.
+ * modules/dirent (Makefile.am): Substitute HAVE_DIRENT_H.
+ * doc/posix-headers/dirent.texi: Mention the MSVC problem.
+
+2011-09-11 Bruno Haible <bruno@clisp.org>
+
Fix wint_t on MSVC.
* lib/wchar.in.h (wint_t): On MSVC, override it.
* lib/wctype.in.h (wint_t): Likewise.
diff --git a/doc/posix-headers/dirent.texi b/doc/posix-headers/dirent.texi
index a89b2bf0bf..84b4078295 100644
--- a/doc/posix-headers/dirent.texi
+++ b/doc/posix-headers/dirent.texi
@@ -14,4 +14,7 @@ glibc 2.8 and others.
Portability problems not fixed by Gnulib:
@itemize
+@item
+This header file is missing on some platforms:
+MSVC 9.
@end itemize
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index ebbc425511..a8b3f490ab 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -22,7 +22,9 @@
@PRAGMA_COLUMNS@
/* The include_next requires a split double-inclusion guard. */
-#@INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#if @HAVE_DIRENT_H@
+# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#endif
#ifndef _@GUARD_PREFIX@_DIRENT_H
#define _@GUARD_PREFIX@_DIRENT_H
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
index fdc2c440d6..5ecfd83058 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,4 +1,4 @@
-# dirent_h.m4 serial 14
+# dirent_h.m4 serial 15
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,12 @@ AC_DEFUN([gl_DIRENT_H],
dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([dirent.h])
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
+ AC_SUBST([HAVE_DIRENT_H])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
diff --git a/modules/dirent b/modules/dirent
index 2e4fbee17c..0fdf94b37a 100644
--- a/modules/dirent
+++ b/modules/dirent
@@ -24,6 +24,7 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
+ -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \