gettimeofday not defined
Corinna Vinschen
corinna-cygwin@cygwin.com
Mon Jun 20 12:58:00 GMT 2016
Hi Stephen,
On Jun 19 19:30, Stephen Sheldon wrote:
> Sometime in the past several months MPlayer stopped compiling for Cygwin. There
> was a complaint about gettimeofday not being defined. The failing file did
> include sys/time.h, which contains a definition. I found one similar report
> on the Cygwin mailing list. I noticed that MPlayer was putting the macro
> "-D_ISOC99_SOURCE=1" on the gcc command line. I replaced it with
> "-D_DEFAULT_SOURCE=1" and MPlayer compiled. It also works without any
> ...SOURCE.
>
> Here is a small test case to show the problem:
>
> //#define _ISOC99_SOURCE 1
> #define _DEFAULT_SOURCE 1
> #include <sys/time.h>
>
> int main() {
> struct timeval start;
>
> gettimeofday(&start, NULL);
> }
>
> It compiles with _DEFAULT_SOURCE or without any ...SOURCE. I hope someone can
> examine the very complicated #if statements in sys/feature.h and sys/time.h
> and tell me that whether I should raise the issue with the MPLayer folks or
> not.
As you might know, the feature test macros in newlib/Cygwin have
been heaviliy revamped to be more aligned with standards.
I examined sys/time.h and it turned out that gettimeofday was
accidentally guarded with __MISC_VISIBLE || __XSI_VISIBLE, while
it's not guarded at all in GLibc. I fixed that in git so this
will be fixed in the (very soon) upcoming next Cygwin release.
Thanks for the report,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160620/6633877d/attachment.sig>
More information about the Cygwin
mailing list