]> Savannah Git Hosting - gnulib.git/commitdiff
Support selective inclusion mechanism of recent mingw.org header files.
authorBruno Haible <bruno@clisp.org>
Sun, 13 May 2018 20:20:13 +0000 (22:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 13 May 2018 20:20:13 +0000 (22:20 +0200)
Reported by Eli Zaretskii <eliz@gnu.org>.

* lib/sys_types.in.h: On mingw, when __need_off_t, __need___off64_t,
__need_ssize_t, or __need_time_t is defined, just include the system's
<sys/types.h>.
* lib/locale.in.h: On mingw, when __need_locale_t is defined, just
include the system's <locale.h>.

ChangeLog
lib/locale.in.h
lib/sys_types.in.h

index 6753aa14be93ef3110a8a52d310c28b091337e49..bd75aedca514d60eb209ee4bad1ea57b14a4af3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-05-13  Bruno Haible  <bruno@clisp.org>
+
+       Support selective inclusion mechanism of recent mingw.org header files.
+       Reported by Eli Zaretskii <eliz@gnu.org>.
+       * lib/sys_types.in.h: On mingw, when __need_off_t, __need___off64_t,
+       __need_ssize_t, or __need_time_t is defined, just include the system's
+       <sys/types.h>.
+       * lib/locale.in.h: On mingw, when __need_locale_t is defined, just
+       include the system's <locale.h>.
+
 2018-05-13  Bruno Haible  <bruno@clisp.org>
 
        Avoid compilation error due to 'mmap' on Android.
index 1b27f1f7656919e55adbc94c9b6821adb8492cd0..804261dcad14d9056a5594550a780e9704a8c4d0 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
-#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
+#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
+    || defined _GL_ALREADY_INCLUDING_LOCALE_H
 
-/* Special invocation conventions to handle Solaris header files
-   (through Solaris 10) when combined with gettext's libintl.h.  */
+/* Special invocation convention:
+   - Inside mingw header files,
+   - To handle Solaris header files (through Solaris 10) when combined
+     with gettext's libintl.h.  */
 
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
 
@@ -212,5 +215,5 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
 #endif
 
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
-#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
index 0f75f4e107a9578f27fa5791cd9c132792184b0a..440eeb38b49d91f5c29bec439c491dce4eacf196 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
+#if defined _WIN32 && !defined __CYGWIN__ \
+    && (defined __need_off_t || defined __need___off64_t \
+        || defined __need_ssize_t || defined __need_time_t)
+
+/* Special invocation convention inside mingw header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
 
 /* The include_next requires a split double-inclusion guard.  */
@@ -92,3 +103,4 @@ typedef unsigned long long int rpl_ino_t;
 
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* __need_XXX */