summaryrefslogtreecommitdiffstats
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-10 23:35:15 +0100
committerJunio C Hamano <gitster@pobox.com>2021-12-10 23:35:15 +0100
commit25be7ec4bff10e8865d2a1e9ccd9e4fe125cbe62 (patch)
tree610dd6a7829573ff03b735a7f498a4d7ec61f44f /git-compat-util.h
parentMerge branch 'yn/complete-date-format-options' (diff)
parentmingw: avoid fallback for {local,gm}time_r() (diff)
downloadgit-25be7ec4bff10e8865d2a1e9ccd9e4fe125cbe62.tar.xz
git-25be7ec4bff10e8865d2a1e9ccd9e4fe125cbe62.zip
Merge branch 'cb/mingw-gmtime-r'
Build fix on Windows. * cb/mingw-gmtime-r: mingw: avoid fallback for {local,gm}time_r()
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 98c4f2c81e..5fa54a7afe 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -148,7 +148,9 @@
/* Approximation of the length of the decimal representation of this type. */
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
-#if defined(__sun__)
+#ifdef __MINGW64__
+#define _POSIX_C_SOURCE 1
+#elif defined(__sun__)
/*
* On Solaris, when _XOPEN_EXTENDED is set, its header file
* forces the programs to be XPG4v2, defeating any _XOPEN_SOURCE