|
51 | 51 | /*
|
52 | 52 | * We use cabal-generated MIN_VERSION_base to adapt to changes of base.
|
53 | 53 | * Nevertheless, as a convenience, we also allow compiling without cabal by
|
54 |
| - * defining trivial MIN_VERSION_base if needed. |
| 54 | + * defining an approximate MIN_VERSION_base if needed. The alternative version |
| 55 | + * guesses the version of base using the version of GHC. This is usually |
| 56 | + * sufficiently accurate. However, it completely ignores minor version numbers, |
| 57 | + * and it makes the assumption that a pre-release version of GHC will ship with |
| 58 | + * base libraries with the same version numbers as the final release. This |
| 59 | + * assumption is violated in certain stages of GHC development, but in practice |
| 60 | + * this should very rarely matter, and will not affect any released version. |
55 | 61 | */
|
56 | 62 | #ifndef MIN_VERSION_base
|
57 |
| -#define MIN_VERSION_base(major1,major2,minor) 0 |
| 63 | +#if __GLASGOW_HASKELL__ >= 709 |
| 64 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=8))) |
| 65 | +#elif __GLASGOW_HASKELL__ >= 707 |
| 66 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=7))) |
| 67 | +#elif __GLASGOW_HASKELL__ >= 705 |
| 68 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=6))) |
| 69 | +#elif __GLASGOW_HASKELL__ >= 703 |
| 70 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=5))) |
| 71 | +#elif __GLASGOW_HASKELL__ >= 701 |
| 72 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=4))) |
| 73 | +#elif __GLASGOW_HASKELL__ >= 700 |
| 74 | +#define MIN_VERSION_base(major1,major2,minor) (((major1)<4)||(((major1) == 4)&&((major2)<=3))) |
| 75 | +#else |
| 76 | +#define MIN_VERSION_base(major1,major2,minor) (0) |
58 | 77 | #endif
|
| 78 | +#endif // MIN_VERSION_base was not defined |
59 | 79 |
|
60 |
| - |
61 |
| -#endif |
| 80 | +#endif // This file was already included |
0 commit comments