diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-10-04 21:11:51 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-10-05 16:21:16 -0400 |
commit | c060854ed5b42b76eda40e290851a315dbbaea04 (patch) | |
tree | 18361559cf0cbcbc915273284277e6b00f7d9a46 /src/win32 | |
parent | 72d6a20be073c2854cca220c851c977171a5a465 (diff) | |
download | libgit2-c060854ed5b42b76eda40e290851a315dbbaea04.tar.gz |
msvc: Properly handle inttypes.h/stdint.h
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/msvc-compat.h | 50 | ||||
-rw-r--r-- | src/win32/posix.h | 3 |
2 files changed, 15 insertions, 38 deletions
diff --git a/src/win32/msvc-compat.h b/src/win32/msvc-compat.h index 64ed18476..93a123f96 100644 --- a/src/win32/msvc-compat.h +++ b/src/win32/msvc-compat.h @@ -10,48 +10,28 @@ #if defined(_MSC_VER) /* access() mode parameter #defines */ -# define F_OK 0 /* existence check */ -# define W_OK 2 /* write mode check */ -# define R_OK 4 /* read mode check */ +# define F_OK 0 /* existence check */ +# define W_OK 2 /* write mode check */ +# define R_OK 4 /* read mode check */ -# define lseek _lseeki64 -# define stat _stat64 -# define fstat _fstat64 +# define lseek _lseeki64 +# define stat _stat64 +# define fstat _fstat64 /* stat: file mode type testing macros */ -# define _S_IFLNK 0120000 -# define S_IFLNK _S_IFLNK +# define _S_IFLNK 0120000 +# define S_IFLNK _S_IFLNK -# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) -# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) -# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) -# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) +# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) +# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) +# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) +# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) -# define mode_t unsigned short +# define mode_t unsigned short /* case-insensitive string comparison */ -# define strcasecmp _stricmp -# define strncasecmp _strnicmp - -#if (_MSC_VER >= 1600) -# include <stdint.h> -#else -/* add some missing <stdint.h> typedef's */ -typedef signed char int8_t; -typedef unsigned char uint8_t; - -typedef short int16_t; -typedef unsigned short uint16_t; - -typedef long int32_t; -typedef unsigned long uint32_t; - -typedef long long int64_t; -typedef unsigned long long uint64_t; - -typedef long long intmax_t; -typedef unsigned long long uintmax_t; -#endif +# define strcasecmp _stricmp +# define strncasecmp _strnicmp #endif diff --git a/src/win32/posix.h b/src/win32/posix.h index 6d783222e..442717e42 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -11,9 +11,6 @@ #include "fnmatch.h" #include "utf8-conv.h" -/* Define the printf format for 64 bit types */ -#define PRId64 "I64d" - GIT_INLINE(int) p_link(const char *GIT_UNUSED(old), const char *GIT_UNUSED(new)) { GIT_UNUSED_ARG(old) |