[commit: ghc] master: Make the Windows-specific part of mkDerivedConstants.c conditional (72d3f4b)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/72d3f4b77eabd7c3023eedfdbaec9379bb791072

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

commit 72d3f4b77eabd7c3023eedfdbaec9379bb791072
Author: Ian Lynagh <[email protected]>
Date:   Thu Sep 13 16:10:32 2012 +0100

    Make the Windows-specific part of mkDerivedConstants.c conditional
    
    It is only generated when mode is Gen_Header; i.e. it's not used
    in the compiler, only the RTS.

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

 includes/mkDerivedConstants.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index bb60df9..b9f4147 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -570,10 +570,15 @@ main(int argc, char *argv[])
     struct_field(snEntry,addr);
 
 #ifdef mingw32_HOST_OS
-    struct_size(StgAsyncIOResult);
-    struct_field(StgAsyncIOResult, reqID);
-    struct_field(StgAsyncIOResult, len);
-    struct_field(StgAsyncIOResult, errCode);
+    /* Note that this conditional part only affects the C headers.
+       That's important, as it means we get the same PlatformConstants
+       type on all platforms. */
+    if (mode == Gen_Header) {
+        struct_size(StgAsyncIOResult);
+        struct_field(StgAsyncIOResult, reqID);
+        struct_field(StgAsyncIOResult, len);
+        struct_field(StgAsyncIOResult, errCode);
+    }
 #endif
 
     switch (mode) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.