Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/8b1fd2609919dfa8b889f13f91e80885177ba737

>---------------------------------------------------------------

commit 8b1fd2609919dfa8b889f13f91e80885177ba737
Author: Ian Lynagh <[email protected]>
Date:   Tue Apr 24 17:19:58 2012 +0100

    A couple of build fixes for Win64

>---------------------------------------------------------------

 includes/Rts.h          |    2 +-
 rts/eventlog/EventLog.c |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/includes/Rts.h b/includes/Rts.h
index c1f4f05..89efb15 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -168,7 +168,7 @@ void _assertFail(const char *filename, unsigned int linenum)
 #define FMT_Word64 "lu"
 #define FMT_Int64  "ld"
 #else
-#if defined(mingw32_HOST_OS)
+#if defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH)
 /* mingw doesn't understand %llu/%lld - it treats them as 32-bit
    rather than 64-bit */
 #define FMT_Word64 "I64u"
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index a310377..66b589e 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -237,7 +237,10 @@ initEventLogging(void)
         // Forked process, eventlog already started by the parent
         // before fork
         event_log_pid = getpid();
-        sprintf(event_log_filename, "%s.%d.eventlog", prog, event_log_pid);
+        // We don't have a FMT* symbol for pid_t, so we go via Word64
+        // to be sure of not losing range. It would be nicer to have a
+        // FMT* symbol or similar, though.
+        sprintf(event_log_filename, "%s.%" FMT_Word64 ".eventlog", prog, 
(StgWord64)event_log_pid);
     }
     stgFree(prog);
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to