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
#undef opendir
#define opendir opendir_safer
+#define GNULIB_defined_opendir 1
# 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));
# 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));
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
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,
/* 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 \