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 committed Aug 31, 2021
2 parents 8735530 + 9e52042 commit 0d6923f
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 @@ -1298,6 +1298,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 @@ -1311,6 +1312,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 0d6923f

Please sign in to comment.