[Top][All Lists]

[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: Sat, 12 May 2018 10:44:54 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; )

Hi Eli,

> The problem described below was found when building the latest pretest
> of wget2 with mingw.org's MinGW system headers and libraries.

Oh, there are still people who use the (old) mingw.org system?
I thought everyone by now had switched to mingw-w64. This (newer) mingw
does not exhibit the behaviour you describe:

Hmm. mingw.org points me to this source:
which also does not fit your description: it doesn't include <sys/types.h>.

> This assumes that the system header sys/types.h can be included just
> once, anywhere in the program, and that is sufficient.  (MinGW's
> time.h includes sys/types.h, which causes it to include Gnulib's
> sys/types.h.)  Is that a portable assumption?

In general, it is a portable assumption. There are very few cases where
such an assumption does not hold, and it requires special handling with
special #ifs in gnulib.

> What happens with MinGW headers is that when MinGW's sys/types.h is
> included from time.h, only a small portion of sys/types.h is
> processed, the one that is relevant to time.h types, and that portion
> doesn't include the types mentioned in the above error messages.  The
> next time sys/types.h is included by the program, the Gnulib header
> decides it doesn't need to delegate to the system header, because
> address@hidden@_SYS_TYPES_H is already defined.  So the relevant
> portions of MinGW's sys/types.h are skipped, and we get the error
> messages.

Please can you attach
  - a copy of the mingw <time.h>,
  - a copy of the mingw <sys/types.h>,
  - the result of preprocessing utimens.c with "-E"?



reply via email to

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