Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1
Thank you both, I misread that page on the versions and didn't see the difference between minor version number and release number. So I can confirm, my 7.0.3 install gives me 700 and my 7.2.1 gives me 702. Everything is good. Thanks! JP On Fri, Oct 14, 2011 at 5:13 PM, Daniel Fischer wrote: > On Friday 14 October 2011, 16:47:45, JP Moresmau wrote: >> Hello list, >> I must be doing something stupid, but what? >> >> ghc --version >> The Glorious Glasgow Haskell Compilation System, version 7.2.1 >> >> ghc -E -optP-dM -cpp Main.hs (per >> http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.h >> tml) >> >> {-# LINE 1 "Main.hs" #-} >> #define mingw32_HOST_OS 1 >> #define i386_BUILD_ARCH 1 >> #define __GLASGOW_HASKELL__ 702 >> #define __STDC_HOSTED__ 1 >> #define i386_HOST_ARCH 1 >> #define mingw32_BUILD_OS 1 >> >> I'm on Windows so everything else is correct except the line that >> tells me I'm using 7.0.2. > > No, __GLASGOW_HASKELL__ == 702 means you're using ghc-7.2.*, not 7.0.2. > > The second and third digit of the version are for the second component, so > 610 was 6.10.*, 612 was 6.12.* > >> Unfortunately I have code that works under 7.0.3 and breaks under >> 7.2.1 (and the 7.2.1 code breaks under 7.0.3, of course) so I don't >> see anything other option than conditional compilation. > > #in __GLASGOW_HASKELL__ >= 702 > -- code for 7.2.1 and greater > #else > -- code for ghc <= 7.0.4 > #endif > > > -- JP Moresmau http://jpmoresmau.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1
On Friday 14 October 2011, 16:47:45, JP Moresmau wrote: > Hello list, > I must be doing something stupid, but what? > > ghc --version > The Glorious Glasgow Haskell Compilation System, version 7.2.1 > > ghc -E -optP-dM -cpp Main.hs (per > http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.h > tml) > > {-# LINE 1 "Main.hs" #-} > #define mingw32_HOST_OS 1 > #define i386_BUILD_ARCH 1 > #define __GLASGOW_HASKELL__ 702 > #define __STDC_HOSTED__ 1 > #define i386_HOST_ARCH 1 > #define mingw32_BUILD_OS 1 > > I'm on Windows so everything else is correct except the line that > tells me I'm using 7.0.2. No, __GLASGOW_HASKELL__ == 702 means you're using ghc-7.2.*, not 7.0.2. The second and third digit of the version are for the second component, so 610 was 6.10.*, 612 was 6.12.* > Unfortunately I have code that works under 7.0.3 and breaks under > 7.2.1 (and the 7.2.1 code breaks under 7.0.3, of course) so I don't > see anything other option than conditional compilation. #in __GLASGOW_HASKELL__ >= 702 -- code for 7.2.1 and greater #else -- code for ghc <= 7.0.4 #endif ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1
On 14 October 2011 16:47, JP Moresmau wrote: > I must be doing something stupid, but what? Nothing stupid, you're just misinterpreting the value of __GLASGOW_HASKELL__. See: http://www.haskell.org/ghc/docs/latest/html/users_guide/version-numbering.html for the correct interpretation. Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1
Hello list, I must be doing something stupid, but what? ghc --version The Glorious Glasgow Haskell Compilation System, version 7.2.1 ghc -E -optP-dM -cpp Main.hs (per http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html) {-# LINE 1 "Main.hs" #-} #define mingw32_HOST_OS 1 #define i386_BUILD_ARCH 1 #define __GLASGOW_HASKELL__ 702 #define __STDC_HOSTED__ 1 #define i386_HOST_ARCH 1 #define mingw32_BUILD_OS 1 I'm on Windows so everything else is correct except the line that tells me I'm using 7.0.2. Unfortunately I have code that works under 7.0.3 and breaks under 7.2.1 (and the 7.2.1 code breaks under 7.0.3, of course) so I don't see anything other option than conditional compilation. What am I doing wrong? Thanks! -- JP Moresmau http://jpmoresmau.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe