MIN_VERSION macros

Herbert Valerio Riedel hvriedel at gmail.com
Fri Sep 25 19:06:58 UTC 2015


On 2015-09-25 at 20:48:52 +0200, Richard Eisenberg wrote:
> I've run into this issue, too. Post a feature request! I can't imagine
> it's too hard to implement.

For the current external CPP we'll probably have to create a temporary
file with the definitions (just like cabal does) to -include (as afaik
you can't easily pass function macros via `-D` to cpp).

However, Anthony has mentioned he's working on an embeddable CPP impl over at

 https://www.reddit.com/r/haskell/comments/3m1wcs/call_for_nominations_haskell_prime_language/cvbp5ym

which would allow to keep the currently in-scope  MIN_VERSION_...()
definitions in-memory w/o a temporary file.


Finally, Cabal would have to be adapted to wrap the definitions with
`#ifndef`s (or omit those altogether when calling a recent enough GHC)




More information about the ghc-devs mailing list