Initial set of changes to support building with MSVC 2013. Right now there's a bunch fo assumptions in the .vcxproj file and some things are not as clean as they should be, but it does build a full build and works (at least the x86 side). The point of this initial checkpoint is to make sure that nothing breaks on the GCC side, that everyone is ok with the changes to the source (or if better fixes/typing can be done).
diff --git a/MathExtras.h b/MathExtras.h
index 98a6cb6..b2c1beb 100644
--- a/MathExtras.h
+++ b/MathExtras.h
@@ -131,7 +131,9 @@
 #endif
 	Count = __builtin_clzll(Value);
 #else
-	if (sizeof(long) == sizeof(int64_t)) {
+#ifndef _MSC_VER
+	if (sizeof(long) == sizeof(int64_t))
+    {
 		if (!Value) return 64;
 		Count = 0;
 		// bisection method for count leading zeros
@@ -143,7 +145,10 @@
 				Count |= Shift;
 			}
 		}
-	} else {
+	}
+    else
+#endif
+    {
 		// get hi portion
 		uint32_t Hi = Hi_32(Value);
 
@@ -250,7 +255,7 @@
 	uint64_t v = Value - ((Value >> 1) & 0x5555555555555555ULL);
 	v = (v & 0x3333333333333333ULL) + ((v >> 2) & 0x3333333333333333ULL);
 	v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
-	return unsigned((uint64_t)(v * 0x0101010101010101ULL) >> 56);
+	return (uint64_t)((v * 0x0101010101010101ULL) >> 56);
 #endif
 }