Mercurial > vim
diff src/os_unix.h @ 18669:9007e9896303 v8.1.2326
patch 8.1.2326: cannot parse a date/time string
Commit: https://github.com/vim/vim/commit/10455d43fef041309ce0613fa792c635dd71e3a8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 21 15:36:18 2019 +0100
patch 8.1.2326: cannot parse a date/time string
Problem: Cannot parse a date/time string.
Solution: Add strptime(). (Stephen Wall, closes #)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 21 Nov 2019 15:45:03 +0100 |
parents | 8f4cc259ed7a |
children | 673f4603d979 |
line wrap: on
line diff
--- a/src/os_unix.h +++ b/src/os_unix.h @@ -127,9 +127,16 @@ # endif #endif +// 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) -# include <time.h> /* on some systems time.h should not be - included together with sys/time.h */ +// 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 # include <sys/time.h>