[commit: ghc] master: fix _FILE_OFFSET_BITS redefined warning on Solaris/i386 platform (78216e2)

git at git.haskell.org git at git.haskell.org
Thu Feb 5 23:42:36 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/78216e227dfb069d3eda804799f1f96716320a1b/ghc

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

commit 78216e227dfb069d3eda804799f1f96716320a1b
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Thu Feb 5 17:35:45 2015 -0600

    fix _FILE_OFFSET_BITS redefined warning on Solaris/i386 platform
    
    Summary:
    The problem with Solaris is that system header files include
    /usr/include/sys/feature_tests.h header file and it tests if
    _FILE_OFFSET_BITS define is defined. If not, it defines it to 32
    which is in conflict with 64 which we need for large file support.
    The solution is easy, always include own header files before system header
    files.
    
    Reviewers: hvr, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D644


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

78216e227dfb069d3eda804799f1f96716320a1b
 libraries/base/include/WCsubst.h        | 2 +-
 libraries/integer-gmp2/cbits/wrappers.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libraries/base/include/WCsubst.h b/libraries/base/include/WCsubst.h
index 4ad373a..11bedb6 100644
--- a/libraries/base/include/WCsubst.h
+++ b/libraries/base/include/WCsubst.h
@@ -2,8 +2,8 @@
 
 #define WCSUBST_INCL
 
-#include <stdlib.h>
 #include "HsFFI.h"
+#include <stdlib.h>
 
 HsInt u_iswupper(HsInt wc);
 HsInt u_iswdigit(HsInt wc);
diff --git a/libraries/integer-gmp2/cbits/wrappers.c b/libraries/integer-gmp2/cbits/wrappers.c
index cf28e29..4b710dc 100644
--- a/libraries/integer-gmp2/cbits/wrappers.c
+++ b/libraries/integer-gmp2/cbits/wrappers.c
@@ -9,6 +9,9 @@
 
 #define _ISOC99_SOURCE
 
+#include "HsFFI.h"
+#include "MachDeps.h"
+
 #include <assert.h>
 #include <stdbool.h>
 #include <stdlib.h>
@@ -20,8 +23,6 @@
 
 #include <gmp.h>
 
-#include "HsFFI.h"
-#include "MachDeps.h"
 
 // GMP 4.x compatibility
 #if !defined(__GNU_MP_VERSION)



More information about the ghc-commits mailing list