patch 8.1.2344: Cygwin: warning for using strptime()

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().
diff --git a/src/os_unix.h b/src/os_unix.h
index a7a0c84..e1c7dee 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 <time.h>
 #endif
 #ifdef HAVE_SYS_TIME_H
diff --git a/src/version.c b/src/version.c
index 9b8a02f..9df71b8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -738,6 +738,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2344,
+/**/
     2343,
 /**/
     2342,
diff --git a/src/vim.h b/src/vim.h
index 4d409d4..c53b141 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 <limits.h>
+# include <limits.h>
 
 /*
  * Cygwin may have fchdir() in a newer release, but in most versions it