Fix some incorrect MSVC #ifdef's. Fixes #1305
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/path.c b/src/path.c
index 5de58cc..263cf9e 100644
--- a/src/path.c
+++ b/src/path.c
@@ -400,7 +400,7 @@ int git_path_fromurl(git_buf *local_path_out, const char *file_url)
if (offset >= len || file_url[offset] == '/')
return error_invalid_local_file_uri(file_url);
-#ifndef _MSC_VER
+#ifndef GIT_WIN32
offset--; /* A *nix absolute path starts with a forward slash */
#endif
diff --git a/tests-clar/clar_libgit2.c b/tests-clar/clar_libgit2.c
index 88ffb2b..63efd59 100644
--- a/tests-clar/clar_libgit2.c
+++ b/tests-clar/clar_libgit2.c
@@ -238,7 +238,7 @@ const char* cl_git_path_url(const char *path)
cl_git_pass(git_path_prettify_dir(&path_buf, path, NULL));
cl_git_pass(git_buf_puts(&url_buf, "file://"));
-#ifdef _MSC_VER
+#ifdef GIT_WIN32
/*
* A FILE uri matches the following format: file://[host]/path
* where "host" can be empty and "path" is an absolute path to the resource.
diff --git a/tests-clar/core/path.c b/tests-clar/core/path.c
index 894e81f..407770b 100644
--- a/tests-clar/core/path.c
+++ b/tests-clar/core/path.c
@@ -324,7 +324,7 @@ static void check_fromurl(const char *expected_result, const char *input, int sh
git_buf_free(&buf);
}
-#ifdef _MSC_VER
+#ifdef GIT_WIN32
#define ABS_PATH_MARKER ""
#else
#define ABS_PATH_MARKER "/"