Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this break compiling Git with older mingw-w64? I ask because I have to do precisely that sometimes, e.g. when building MinGit backports.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no; I obviously tested this change is safe both with the old (from SDK 1.0.8 as released) and new (currently updated) mingw-w64 headers and forgot to mention it.

I am doing an additional test with SDK 1.0.7 (even older releases won't install because of bintray or key issues), but I would be surprised that it wouldn't work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for confirming!

/*
* On Solaris, when _XOPEN_EXTENDED is set, its header file
* forces the programs to be XPG4v2, defeating any _XOPEN_SOURCE
Expand Down