diff options
author | Gary Johnson <garyjohn@spocom.com> | 2021-10-28 20:49:06 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-28 20:49:06 +0100 |
commit | 44db603f691b58a8531e8ff528e0a7ce644257b2 (patch) | |
tree | b3092def8d2b99508d43d37caff55d68b3801be0 /src/vim.h | |
parent | 2446ec9b567ce2b72bd06d121f200f40bbdc8a84 (diff) |
patch 8.2.3566: build failure on old systems when using nano timestampv8.2.3566
Problem: Build failure on old systems when using nano timestamp.
Solution: Define _BSD_SOURCE, _SVID_SOURCE and _DEFAULT_SOURCE. (Gary
Johnson, closes #9054)
Diffstat (limited to 'src/vim.h')
-rw-r--r-- | src/vim.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -43,6 +43,21 @@ // 700 is needed for mkdtemp(). # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 700 + +// On old systems, defining _XOPEN_SOURCE causes _BSD_SOURCE, _SVID_SOURCE +// and/or // _DEFAULT_SOURCE not to be defined, so do that here. Those are +// needed to include nanosecond-resolution timestamps in struct stat. On new +// systems, _DEFAULT_SOURCE is needed to avoid warning messages about using +// deprecated _BSD_SOURCE or _SVID_SOURCE. +# ifndef _BSD_SOURCE +# define _BSD_SOURCE 1 +# endif +# ifndef _SVID_SOURCE +# define _SVID_SOURCE 1 +# endif +# ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +# endif # endif # endif |