Move mkstemp and PRIuMAX to compat/mingw.h.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2008-03-13 13:01:01 +01:00
parent e69e2c6838
commit 9151da6b3b
2 changed files with 12 additions and 11 deletions

View File

@@ -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
*/

View File

@@ -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;