summaryrefslogtreecommitdiff
path: root/lib/stdio.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-01-01 01:32:27 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-01-01 01:32:56 -0800
commit5a59e28dec039453aaad27fd0919bb93ed517079 (patch)
treeaea1913198992523e05fc1b52c9930df9de052cb /lib/stdio.in.h
parentbcf244ef9be0fe61f4b9a48d3412b2c8a9f1edb9 (diff)
downloademacs-5a59e28dec039453aaad27fd0919bb93ed517079.tar.gz
Merge from gnulib
This incorporates: 2016-12-19 stdint: Fix WINT_MAX to match wint_t on mingw 2016-12-18 getopt: Fix link error for users of getopt() in <unistd.h> 2016-12-17 getlogin: Port to newer mingw 2016-12-17 stdint: Fix WINT_MAX to match wint_t on MSVC 2016-12-17 Avoid redefinition errors on MSVC * lib/getopt.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/unistd.in.h: * m4/stdint.m4, m4/unistd_h.m4: Copy from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. Plus, this commit updates the indenting on copyright notices to match that of gnulib.
Diffstat (limited to 'lib/stdio.in.h')
-rw-r--r--lib/stdio.in.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 4c7ee55fd05..d706377f984 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -118,6 +118,26 @@
# include <unistd.h>
#endif
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include
+ it before we #define perror rpl_perror. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include
+ it before we #define remove rpl_remove. */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include
+ it before we #define rename rpl_rename. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <io.h>
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */