]> git.cworth.org Git - apitrace/blobdiff - common/os_win32.cpp
Resolve some MS compiler warnings (in picky mode)
[apitrace] / common / os_win32.cpp
index e9306cdc6dfa0168b3bca328d5511b66bb551932..bd4b06d46c919d94f2f0e2d24002564db2c9c011 100644 (file)
@@ -42,7 +42,7 @@ String
 getProcessName(void)
 {
     String path;
-    size_t size = MAX_PATH;
+    DWORD size = MAX_PATH;
     char *buf = path.buf(size);
 
     DWORD nWritten = GetModuleFileNameA(NULL, buf, size);
@@ -57,7 +57,7 @@ String
 getCurrentDir(void)
 {
     String path;
-    size_t size = MAX_PATH;
+    DWORD size = MAX_PATH;
     char *buf = path.buf(size);
     
     DWORD ret = GetCurrentDirectoryA(size, buf);
@@ -69,6 +69,12 @@ getCurrentDir(void)
     return path;
 }
 
+bool
+createDirectory(const String &path)
+{
+    return CreateDirectoryA(path, NULL);
+}
+
 bool
 String::exists(void) const
 {
@@ -229,11 +235,7 @@ long long timeFrequency = 0LL;
 void
 abort(void)
 {
-#ifndef NDEBUG
-    DebugBreak();
-#else
-    ExitProcess(0);
-#endif
+    TerminateProcess(GetCurrentProcess(), 1);
 }
 
 
@@ -299,7 +301,7 @@ unhandledExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
 
     static int recursion_count = 0;
     if (recursion_count) {
-        fprintf(stderr, "apitrace: warning: recursion handling exception\n");
+        fputs("apitrace: warning: recursion handling exception\n", stderr);
     } else {
         if (gCallback) {
             ++recursion_count;