diff --git a/compat/mingw.h b/compat/mingw.h index 50973bc193..64e0ac79e3 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -123,6 +123,7 @@ static inline int waitpid(pid_t pid, unsigned *status, unsigned options) int pipe(int filedes[2]); unsigned int sleep (unsigned int seconds); +int mkstemp(char *template); int gettimeofday(struct timeval *tv, void *tz); int poll(struct pollfd *ufds, unsigned int nfds, int timeout); struct tm *gmtime_r(const time_t *timep, struct tm *result); @@ -187,6 +188,12 @@ static inline unsigned int git_ntohl(unsigned int x) sig_handler_t mingw_signal(int sig, sig_handler_t handler); #define signal mingw_signal +/* + * git specific compatibility + */ + +#define PRIuMAX "I64u" + /* * helpers */ diff --git a/git-compat-util.h b/git-compat-util.h index 73b08397c9..aac06bfefe 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -106,11 +106,7 @@ #endif #ifndef PRIuMAX -#ifndef __MINGW32__ #define PRIuMAX "llu" -#else -#define PRIuMAX "I64u" -#endif #endif #ifdef __GNUC__ @@ -171,9 +167,11 @@ extern int git_munmap(void *start, size_t length); #define pread git_pread extern ssize_t git_pread(int fd, void *buf, size_t count, off_t offset); #endif -/* Forward decl that will remind us if its twin in cache.h changes. - This function in used in compat/pread.c. But we can't include - cache.h there. */ +/* + * Forward decl that will remind us if its twin in cache.h changes. + * This function is used in compat/pread.c. But we can't include + * cache.h there. + */ extern int read_in_full(int fd, void *buf, size_t count); #ifdef NO_SETENV @@ -379,10 +377,6 @@ static inline FILE *xfdopen(int fd, const char *mode) return stream; } -#ifdef __MINGW32__ -int mkstemp(char *template); -#endif - static inline int xmkstemp(char *template) { int fd;