I\'m contributing to Alex, and it obviously depends on a lot of libraries and should compile for a lot of versions.
I need to use a function that is only available from
Read the fine documentation:
For version x.y.z of GHC, the value of
__GLASGOW_HASKELL__
is the integer xyy (if y is a single digit, then a leading zero is added, so for example in version 6.2 of GHC,__GLASGOW_HASKELL__
==602). More information in Section 1.4, “GHC version numbering policy”.With any luck,
__GLASGOW_HASKELL__
will be undefined in all other implementations that support C-style pre-processing.(For reference: the comparable symbols for other systems are:
__HUGS__
for Hugs,__NHC__
for nhc98, and__HBC__
for hbc.)NB. This macro is set when pre-processing both Haskell source and C source, including the C source generated from a Haskell module (i.e. .hs, .lhs, .c and .hc files).