+2019-06-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ unistd: stddef.h and sys/types.h namespace cleanup
+ * lib/unistd.in.h [__GLIBC__]:
+ Do not include stddef.h or sys/types.h.
+ [!__GLIBC__]: Always include sys/types.h, since unistd.h is
+ supposed to declare off_t and ssize_t. Problem found when looking
+ at why @GNULIB_PWRITE@ was different from the newly-added
+ @GNULIB_COPY_FILE_RANGE@ with respect to ssize_t.
+
2019-06-22 Akim Demaille <akim@lrde.epita.fr>
maintainer-makefile: restore portability to non-GNU awks
#define _@GUARD_PREFIX@_UNISTD_H
/* NetBSD 5.0 mis-defines NULL. Also get size_t. */
-#include <stddef.h>
+/* But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <stddef.h>
+#endif
/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
/* MSVC defines off_t in <sys/types.h>.
May also define off_t to a 64-bit type on native Windows. */
-#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
-/* Get off_t. */
-# include <sys/types.h>
-#endif
-
-#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
- || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
- || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
-/* Get ssize_t. */
+/* But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+/* Get off_t, ssize_t. */
# include <sys/types.h>
#endif