Christian wrote:

> > > On Di, 26 Nov 2019, Bram Moolenaar wrote:
> > > 
> > > > Patch 8.1.2344
> > > > Problem:    Cygwin: warning for using strptime().
> > > > Solution:   Move defining _XOPEN_SOURCE and __USE_XOPEN to vim.h. (Ken 
> > > > Takata,
> > > >             closes #5265)  Use 700 for _XOPEN_SOURCE for mkdtemp().
> > > > Files:      src/os_unix.h, src/vim.h
> > > 
> > > This still breaks on BSD like systems.
> > > 
> > > How about the following patch on top of it?
> > > 
> > > diff --git a/src/vim.h b/src/vim.h
> > > index 9b49ba1a9..c0053ce14 100644
> > > --- a/src/vim.h
> > > +++ b/src/vim.h
> > > @@ -36,8 +36,8 @@
> > >      Error: configure did not run properly.  Check auto/config.log.
> > >  # endif
> > > 
> > > -# if defined(UNIX) && !defined(MACOS_X)
> > > -// Needed for strptime().  Needs to be done early, since header files can
> > > +# if defined(UNIX) && !defined(MACOS_X) && !defined(__unix__)
> > 
> > Why use __unix__ ?  It's not used anywhere in Vim. There is an existing
> > check for BSD.
> 
> __unix__ seems to be specific to well, unix like systems. I first tried, 
> defined(BSD), this did not work and is not defined (perhaps only 
> later?). Then I tried __FreeBSD__ that worked, but I assume it is too 
> specific. So I hoped __unix__ would do the trick.

FreeBSD and Cygwin are also a kind of Unix.

Defining _XOPEN_SOURCE in os_unix.h was probably a mistake.  It should
be done before including anything, as the header files where it is
relevant can easily be included indirectly.

What was the error on FreeBSD?  I thought it also suppored Posix.

I think being specific is OK, thus checking for __FreeBSD__ would be OK.
Otherwise we would need a configure check of some kind.

-- 
In a world without fences, who needs Gates and Windows?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201911272145.xARLjLOA007508%40masaka.moolenaar.net.

Raspunde prin e-mail lui