]> Savannah Git Hosting - gnulib.git/commitdiff
glob, etc.: port to MSVC v18 on MS-Windows 8.1
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Feb 2015 04:44:32 +0000 (20:44 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Feb 2015 04:45:51 +0000 (20:45 -0800)
* lib/dirent--.h (GNULIB_defined_opendir):
* lib/dirent.in.h (GNULIB_defined_opendir)
(GNULIB_defined_closedir):
* lib/getcwd.c, lib/glob.c, lib/mountlist.c (opendir, closedir):
#undef only if Gnulib defined it.

ChangeLog
lib/dirent--.h
lib/dirent.in.h
lib/getcwd.c
lib/glob.c
lib/mountlist.c

index 42351a6831bec88e07c25e21f5cec76f13afeaf1..86bab1664bf7c53bf92cb49d1afb8ee483395d4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-02-24  Paul Eggert  <eggert@cs.ucla.edu>
 
+       glob, etc.: port to MSVC v18 on MS-Windows 8.1
+       * lib/dirent--.h (GNULIB_defined_opendir):
+       * lib/dirent.in.h (GNULIB_defined_opendir)
+       (GNULIB_defined_closedir):
+       * lib/getcwd.c, lib/glob.c, lib/mountlist.c (opendir, closedir):
+       #undef only if Gnulib defined it.
+
        poll: port to MSVC v18 on MS-Windows 8.1
        Problem reported by Gisle Vanem in:
        http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00139.html
index 17a88538795ec3ef8da4d34c20cd14d7563b5b38..aa3f4929cb2ced584b43cf2232a80427fb75a695 100644 (file)
@@ -21,3 +21,4 @@
 
 #undef opendir
 #define opendir opendir_safer
+#define GNULIB_defined_opendir 1
index ddd3b84fbb289fefd16d89e6a95f26da1dffbd4b..154d2689e3da7cc1330f1063f61e098f7fe3dc87 100644 (file)
@@ -77,6 +77,7 @@ typedef struct gl_directory DIR;
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef opendir
 #   define opendir rpl_opendir
+#   define GNULIB_defined_opendir 1
 #  endif
 _GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
@@ -128,6 +129,7 @@ _GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef closedir
 #   define closedir rpl_closedir
+#   define GNULIB_defined_closedir 1
 #  endif
 _GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
index 20efabd6d372fbcdcb6c451716cd0e6896e4e062..db5279dba10a1eac065cc484ca0c1a8d97658db5 100644 (file)
    FIXME - if the kernel ever adds support for multi-thread safety for
    avoiding standard fds, then we should use opendir_safer and
    openat_safer.  */
-#undef opendir
-#undef closedir
+#ifdef GNULIB_defined_opendir
+# undef opendir
+#endif
+#ifdef GNULIB_defined_closedir
+# undef closedir
+#endif
 \f
 /* Get the name of the current working directory, and put it in SIZE
    bytes of BUF.  Returns NULL if the directory couldn't be determined or
index f13cb8a267bf29e6599abfadccf76226b6863f88..ed49a9d2f6be46829ff72c4234f48845f2ca2597 100644 (file)
@@ -188,8 +188,12 @@ static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
    therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
    FIXME - if the kernel ever adds support for multi-thread safety for
    avoiding standard fds, then we should use opendir_safer.  */
-# undef opendir
-# undef closedir
+# ifdef GNULIB_defined_opendir
+#  undef opendir
+# endif
+# ifdef GNULIB_defined_closedir
+#  undef closedir
+# endif
 
 # if HAVE_ALLOCA
 /* The OS usually guarantees only one guard page at the bottom of the stack,
index 6fed3575a4fc3349d9489168ccb02a9975fd3769..dce4ce6f7a63dfe65abf2c7feb92c242155e0992 100644 (file)
 
 /* The results of opendir() in this file are not used with dirfd and fchdir,
    therefore save some unnecessary work in fchdir.c.  */
-#undef opendir
-#undef closedir
+#ifdef GNULIB_defined_opendir
+# undef opendir
+#endif
+#ifdef GNULIB_defined_closedir
+# undef closedir
+#endif
 
 #define ME_DUMMY_0(Fs_name, Fs_type)            \
   (strcmp (Fs_type, "autofs") == 0              \