Skip to content

Commit b2eeeed

Browse files
committed
squash! Port header fixes from MSys2
Replace the commit message with this one: Assorted header fixes to support MSys2-based MinGW build The excellent MSys2 project brings a substantially updated MinGW environment including newer GCC versions and new headers. To support compiling Git, let's special-case the new MinGW (tell-tale: the _MINGW64_VERSION_MAJOR constant is defined). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 3cd528c commit b2eeeed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/mingw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ static inline int symlink(const char *oldpath, const char *newpath)
9999
{ errno = ENOSYS; return -1; }
100100
static inline int fchmod(int fildes, mode_t mode)
101101
{ errno = ENOSYS; return -1; }
102+
#ifndef __MINGW64_VERSION_MAJOR
102103
static inline pid_t fork(void)
103104
{ errno = ENOSYS; return -1; }
105+
#endif
104106
static inline unsigned int alarm(unsigned int seconds)
105107
{ return 0; }
106108
static inline int fsync(int fd)
@@ -390,8 +392,10 @@ static inline char *mingw_find_last_dir_sep(const char *path)
390392
int mingw_offset_1st_component(const char *path);
391393
#define offset_1st_component mingw_offset_1st_component
392394
#define PATH_SEP ';'
395+
#ifndef __MINGW64_VERSION_MAJOR
393396
#define PRIuMAX "I64u"
394397
#define PRId64 "I64d"
398+
#endif
395399

396400
void mingw_open_html(const char *path);
397401
#define open_html mingw_open_html

0 commit comments

Comments
 (0)