Browse Source

Fixed MSVC.

Branimir Karadžić 8 years ago
parent
commit
b7f1772545
1 changed files with 16 additions and 0 deletions
  1. 16 0
      src/filepath.cpp

+ 16 - 0
src/filepath.cpp

@@ -455,7 +455,23 @@ namespace bx
 			return false;
 			return false;
 		}
 		}
 
 
+#if BX_CRT_MSVC
+		int32_t result;
+		FileInfo fi;
+		if (stat(_filePath, fi) )
+		{
+			if (FileInfo::Directory == fi.m_type)
+			{
+				result = ::_rmdir(_filePath.get() );
+			}
+			else
+			{
+				result = ::remove(_filePath.get() );
+			}
+		}
+#else
 		int32_t result = ::remove(_filePath.get() );
 		int32_t result = ::remove(_filePath.get() );
+#endif // BX_CRT_MSVC
 
 
 		if (0 != result)
 		if (0 != result)
 		{
 		{