Skip to content

Commit

Permalink
Merge pull request #3398 from carenas/pthread-unistd
Browse files Browse the repository at this point in the history
mingw: avoid fallback for {local,gm}time_r()
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Oct 13, 2021
2 parents b8ce1ea + 0ff9dc3 commit 7f6954b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ int pipe(int filedes[2])
return 0;
}

#ifndef __MINGW64__
struct tm *gmtime_r(const time_t *timep, struct tm *result)
{
if (gmtime_s(result, timep) == 0)
Expand All @@ -1104,6 +1105,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
return result;
return NULL;
}
#endif

char *mingw_strbuf_realpath(struct strbuf *resolved, const char *path)
{
Expand Down
4 changes: 3 additions & 1 deletion git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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
Expand Down

0 comments on commit 7f6954b

Please sign in to comment.