base-feature-macros 0.1 → 0.1.0.1
raw patch · 3 files changed
+24/−6 lines, 3 files
Files
- ChangeLog.md +10/−0
- base-feature-macros.cabal +9/−5
- base-feature-macros.h +5/−1
+ ChangeLog.md view
@@ -0,0 +1,10 @@+# Revision history for base-feature-macros++## 0.1.0.1++* Fix `HAVE_SEMIGROUP_IN_BASE` (#2)+* Add protection against transitive leakage++## 0.1++* First release
base-feature-macros.cabal view
@@ -1,5 +1,5 @@ name: base-feature-macros-version: 0.1+version: 0.1.0.1 synopsis: Semantic CPP feature macros for base license: BSD3 license-file: LICENSE@@ -8,19 +8,21 @@ category: Development build-type: Simple cabal-version: >=1.10- bug-reports: https://github.com/hvr/base-feature-macros/issues- description: This provides a set of feature macros describing features of @base@ in a semantic way. .- See <src/base-feature-macros.h base-feature-macros.h> for set of currently provided macros.+ See \<</package/base-feature-macros/src/base-feature-macros.h base-feature-macros.h>\> for the set of currently provided macros. . In order to use the CPP header provided by this package, add this package as a dependency to your @.cabal@ file, i.e. . > build-depends: base-feature-macros: >= 0.1 && < 0.2 .- while making sure that the version specified as lower bound defines the feature-macros your code tests for. This is particularly important as CPP will implicitly treat undefined CPP macros as having the value @0@. See also GNU CPP/CC's @-Wundef@ warning to detect such errors.+ while making sure that the version specified as lower bound defines the feature-macros your code tests for. This is particularly important as CPP will implicitly treat undefined CPP macros as having the value @0@. See also GNU CPP/CC's @-Wundef@ warning to detect such errors;+ or starting with GHC 8.2, <https://downloads.haskell.org/~ghc/master/users-guide/using-warnings.html#ghc-flag--Wcpp-undef -Wcpp-undef> can be used: .+ > if impl(ghc >= 8.2)+ > ghc-options: -Wcpp-undef+ . Then in your code, you can include and use the @\<base-feature-macros.h\>@ header like so . > module M where@@ -37,6 +39,8 @@ . This package is inspired by the blogpost <https://github.com/quchen/articles/blob/master/haskell-cpp-compatibility.md "Make macros mean something – readable backwards compatibility with CPP">.++extra-source-files: ChangeLog.md source-repository head type: git
base-feature-macros.h view
@@ -5,6 +5,10 @@ #error MIN_VERSION_base macro not defined #endif +#if !defined(MIN_VERSION_base_feature_macros)+#error MIN_VERSION_base_feature_macros macro not defined+#endif+ /* @since 0.1 */ #define HAVE_APPLICATIVE_MONAD MIN_VERSION_base(4,8,0) @@ -18,7 +22,7 @@ #define HAVE_NATURAL_IN_BASE MIN_VERSION_base(4,8,0) /* @since 0.1 */-#define HAVE_SEMIGROUP_IN_BASE MIN_VERSION_base(4,8,0)+#define HAVE_SEMIGROUP_IN_BASE MIN_VERSION_base(4,9,0) /* @since 0.1 */ #define HAVE_MONAD_FAIL MIN_VERSION_base(4,9,0)