[commit: base] encoding: Un-bump base version because MIN_VERSION doesn't work anyway (2ffa99d)

Simon Marlow marlowsd at gmail.com
Thu Apr 7 10:26:41 CEST 2011


On 06/04/2011 21:24, Max Bolingbroke wrote:
> On 6 April 2011 18:04, Ian Lynagh<igloo at earth.li>  wrote:
>> On Wed, Apr 06, 2011 at 07:36:31AM -0700, Max Bolingbroke wrote:
>>>
>>>      Un-bump base version because MIN_VERSION doesn't work anyway
>>
>> Really? It should, as far as I know.
>
> It doesn't seem to be defined when the libraries are built by the GHC
> build system, only when they are built by the Cabal build system.
> __GLASGOW_HASKELL__ is of course available and was suitable for my
> needs, but it would be cool if MIN_VERSION_* was available as well.
>
> When I got the errors about it being undefined it was on a .hsc file -
> if it is meant to work, perhaps the problem is that the build system
> isn't supplying the macros to hsc2hc?

It works for .hs files, and for .hsc files as long as you don't need it 
to be expanded by hsc2hs (i.e. use ##if, not #if).

This is how the macro is included when compiling ordinary .hs files 
(rules/distdir-way-opts.mk):

  $$(if $$($1_PACKAGE),-optP-include 
-optP$1/$2/build/autogen/cabal_macros.h) \

Maybe we could do the same for hsc2hs too.  Does Cabal do that?

Cheers,
	Simon



More information about the Cvs-libraries mailing list