bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation errors using Gnulib's time.h on MinGW


From: Bruno Haible
Subject: Re: Compilation errors using Gnulib's time.h on MinGW
Date: Sun, 13 May 2018 22:20:06 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; )

Eli Zaretskii wrote:
> Attached below.

Thanks. The following patch should fix this scenario (or at least, make it
easier to solve).


2018-05-13  Bruno Haible  <address@hidden>

        Support selective inclusion mechanism of recent mingw.org header files.
        Reported by Eli Zaretskii <address@hidden>.
        * 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>.

diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index 0f75f4e..440eeb3 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -20,6 +20,17 @@
 #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.  */
+
address@hidden@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef address@hidden@_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 /* address@hidden@_SYS_TYPES_H */
 #endif /* address@hidden@_SYS_TYPES_H */
+#endif /* __need_XXX */
diff --git a/lib/locale.in.h b/lib/locale.in.h
index 1b27f1f..804261d 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -19,10 +19,13 @@
 #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.  */
 
 address@hidden@ @NEXT_LOCALE_H@
 
@@ -212,5 +215,5 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some 
glibc systems - "
 #endif
 
 #endif /* address@hidden@_LOCALE_H */
-#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
 #endif /* address@hidden@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]