Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2009-06-15 01:12:20 +0400
committerAndreas Ericsson <ae@op5.se>2009-06-15 09:34:28 +0400
commit8a086f872a3bb2cf8e437f0e374ea18e5cbaa899 (patch)
treec2ef0cadc189a076b8ed0d855da1e58502210507 /src/common.h
parent2bf93fa1071c3df7f43926c8e6c3bd2353d78160 (diff)
win32: Add support for the MS Visual C/C++ compiler
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/common.h b/src/common.h
index 32679a954..d4b976905 100644
--- a/src/common.h
+++ b/src/common.h
@@ -6,11 +6,14 @@
#endif
#include "git/thread-utils.h"
+#include "cc-compat.h"
#ifdef GIT_HAS_PTHREAD
# include <pthread.h>
#endif
-#include <inttypes.h>
+#ifdef GIT_HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
#include <assert.h>
#include <errno.h>
#include <limits.h>
@@ -26,9 +29,21 @@
# include <direct.h>
# include <windows.h>
-#define snprintf _snprintf
+# define snprintf _snprintf
-typedef int ssize_t;
+# if (defined(_MSC_VER) && defined(_WIN64)) || \
+ (defined(__DMC__) && defined(_M_AMD64))
+ typedef long long ssize_t;
+# else
+ typedef int ssize_t;
+# endif
+
+# 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 */
+# endif
#else
@@ -37,7 +52,6 @@ typedef int ssize_t;
#endif
-#include "cc-compat.h"
#include "git/common.h"
#include "util.h"
#include "thread-utils.h"
@@ -45,4 +59,13 @@ typedef int ssize_t;
#define GIT_PATH_MAX 4096
+#ifndef GIT_HAVE_INTTYPES_H
+/* add some missing <stdint.h> typedef's */
+typedef long int32_t;
+typedef unsigned long uint32_t;
+
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+#endif
+
#endif /* INCLUDE_common_h__ */