diff --git a/src/os_unix.h b/src/os_unix.h index a7a0c841f1..e1c7deee1c 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -129,13 +129,6 @@ // on some systems time.h should not be included together with sys/time.h #if !defined(HAVE_SYS_TIME_H) || defined(TIME_WITH_SYS_TIME) -// Needed for strptime() -# ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE -# endif -# ifndef __USE_XOPEN -# define __USE_XOPEN -# endif # include #endif #ifdef HAVE_SYS_TIME_H diff --git a/src/version.c b/src/version.c index 9b8a02fac1..9df71b8add 100644 --- a/src/version.c +++ b/src/version.c @@ -737,6 +737,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2344, /**/ 2343, /**/ diff --git a/src/vim.h b/src/vim.h index 4d409d46fd..c53b1416f2 100644 --- a/src/vim.h +++ b/src/vim.h @@ -36,8 +36,21 @@ Error: configure did not run properly. Check auto/config.log. # endif +# ifdef UNIX +// Needed for strptime(). Needs to be done early, since header files can +// include other header files and end up including time.h, where these symbols +// matter for Vim. +// 700 is needed for mkdtemp(). +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 700 +# endif +# ifndef __USE_XOPEN +# define __USE_XOPEN +# endif +# endif + // for INT_MAX, LONG_MAX et al. -#include +# include /* * Cygwin may have fchdir() in a newer release, but in most versions it