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


*** ../vim-8.1.2343/src/os_unix.h       2019-11-21 15:36:00.245478796 +0100
--- src/os_unix.h       2019-11-26 13:11:43.968908469 +0100
***************
*** 129,141 ****
  
  // 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
--- 129,134 ----
*** ../vim-8.1.2343/src/vim.h   2019-11-13 22:35:15.755521778 +0100
--- src/vim.h   2019-11-26 13:27:12.641051557 +0100
***************
*** 36,43 ****
      Error: configure did not run properly.  Check auto/config.log.
  # endif
  
  // for INT_MAX, LONG_MAX et al.
! #include <limits.h>
  
  /*
   * Cygwin may have fchdir() in a newer release, but in most versions it
--- 36,56 ----
      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>
  
  /*
   * Cygwin may have fchdir() in a newer release, but in most versions it
*** ../vim-8.1.2343/src/version.c       2019-11-26 12:23:26.679820852 +0100
--- src/version.c       2019-11-26 13:14:39.153266915 +0100
***************
*** 739,740 ****
--- 739,742 ----
  {   /* Add new patch number below this line */
+ /**/
+     2344,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
124. You begin conversations with, "Who is your internet service provider?"

 /// 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/201911261229.xAQCTo91008073%40masaka.moolenaar.net.

Raspunde prin e-mail lui