Drop redundant `-D__GLASGOW_HASKELL__=...` flag
authorHerbert Valerio Riedel <hvr@gnu.org>
Thu, 31 Dec 2015 15:58:28 +0000 (16:58 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Thu, 31 Dec 2015 16:00:21 +0000 (17:00 +0100)
In 3549c952b535803270872adaf87262f2df0295a4 a `include/ghcversions.h` include
file was introduced which defines `__GLASGOW_HASKELL__` as well.

So there's no need to define it twice.

compiler/main/DriverPipeline.hs
includes/ghc.mk

index 4936ace..d3038bc 100644 (file)
@@ -1191,9 +1191,7 @@ runPhase (RealPhase cc_phase) input_fn dflags
                        ++ verbFlags
                        ++ [ "-S" ]
                        ++ cc_opt
-                       ++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt
-                          , "-include", ghcVersionH
-                          ]
+                       ++ [ "-include", ghcVersionH ]
                        ++ framework_paths
                        ++ split_opt
                        ++ include_paths
@@ -2032,10 +2030,7 @@ doCpp dflags raw input_fn output_fn = do
 #endif
     -- Default CPP defines in Haskell source
     ghcVersionH <- getGhcVersionPathName dflags
-    let hsSourceCppOpts =
-          [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt
-          , "-include", ghcVersionH
-          ]
+    let hsSourceCppOpts = [ "-include", ghcVersionH ]
 
     -- MIN_VERSION macros
     let uids = explicitPackages (pkgState dflags)
index e87a487..aacca08 100644 (file)
@@ -60,9 +60,7 @@ $(includes_H_VERSION) : mk/project.mk | $$(dir $$@)/.
        @echo "#ifndef __GHCVERSION_H__"  > $@
        @echo "#define __GHCVERSION_H__" >> $@
        @echo >> $@
-       @echo "#ifndef __GLASGOW_HASKELL__" >> $@
-       @echo "# define __GLASGOW_HASKELL__ $(ProjectVersionInt)" >> $@
-       @echo "#endif" >> $@
+       @echo "#define __GLASGOW_HASKELL__ $(ProjectVersionInt)" >> $@
        @echo >> $@
        @if [ -n "$(ProjectPatchLevel1)" ]; then \
          echo "#define __GLASGOW_HASKELL_PATCHLEVEL1__ $(ProjectPatchLevel1)" >> $@; \