Fix printf formats for pathchar on Windows (where it's wchar_t, not char)
authorSimon Marlow <marlowsd@gmail.com>
Wed, 4 Sep 2013 10:00:12 +0000 (11:00 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 4 Sep 2013 10:11:10 +0000 (11:11 +0100)
includes/rts/Linker.h
rts/CheckUnload.c
rts/Linker.c

index e900e85..28f0a0e 100644 (file)
 
 #if defined(mingw32_HOST_OS)
 typedef wchar_t pathchar;
+#define PATH_FMT "ls"
 #else
 typedef char    pathchar;
+#define PATH_FMT "s"
 #endif
 
 /* initialize the object linker */
index a758b06..0485ed4 100644 (file)
@@ -254,7 +254,7 @@ void checkUnload (StgClosure *static_objects)
 
   // Mark every unloadable object as unreferenced initially
   for (oc = unloaded_objects; oc; oc = oc->next) {
-      IF_DEBUG(linker, debugBelch("Checking whether to unload %s\n",
+      IF_DEBUG(linker, debugBelch("Checking whether to unload %" PATH_FMT "\n",
                                   oc->fileName));
       oc->referenced = rtsFalse;
   }
@@ -290,12 +290,12 @@ void checkUnload (StgClosure *static_objects)
           } else {
               prev->next = oc->next;
           }
-          IF_DEBUG(linker, debugBelch("Unloading object file %s\n",
+          IF_DEBUG(linker, debugBelch("Unloading object file %" PATH_FMT "\n",
                                       oc->fileName));
           freeObjectCode(oc);
       } else {
-          IF_DEBUG(linker, debugBelch("Object file still in use: %s\n",
-                                      oc->fileName));
+          IF_DEBUG(linker, debugBelch("Object file still in use: %"
+                                      PATH_FMT "\n", oc->fileName));
       }
   }
 
index 6490242..c8451b0 100644 (file)
@@ -169,7 +169,6 @@ static ObjectCode* mkOc( pathchar *path, char *image, int imageSize,
 #define struct_stat struct _stat
 #define open wopen
 #define WSTR(s) L##s
-#define PATH_FMT "S"
 #else
 #define pathcmp strcmp
 #define pathlen strlen
@@ -177,7 +176,6 @@ static ObjectCode* mkOc( pathchar *path, char *image, int imageSize,
 #define pathstat stat
 #define struct_stat struct stat
 #define WSTR(s) s
-#define PATH_FMT "s"
 #endif
 
 static pathchar* pathdup(pathchar *path)