Commit 8c29dca6c372cae1c6a97d78252ee1d7ac10673b

Philip Kelley 2013-02-11T09:25:57

Fix some incorrect MSVC #ifdef's. Fixes #1305

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 "/"