base-feature-macros: Semantic CPP feature macros for base

[ bsd3, development, library ] [ Propose Tags ] [ Report a vulnerability ]

This provides a set of feature macros describing features of base in a semantic way.

See base-feature-macros.h for 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.

Then in your code, you can include and use the <base-feature-macros.h> header like so

module M where

#include <base-feature-macros.h>

#if !HAVE_FOLDABLE_TRAVERSABLE_IN_PRELUDE
import Data.Foldable (Foldable (..))
import Prelude       hiding (foldr, foldr1)
#endif
#if !HAVE_MONOID_IN_PRELUDE
import Data.Monoid hiding ((<>))
#endif

This package is inspired by the blogpost &quot;Make macros mean something &#8211; readable backwards compatibility with CPP&quot;.

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.0.1
Dependencies base (>=4.3 && <4.11) [details]
License BSD-3-Clause
Author Herbert Valerio Riedel
Maintainer hvr@gnu.org
Revised Revision 1 made by HerbertValerioRiedel at 2017-05-13T08:39:39Z
Category Development
Bug tracker https://github.com/hvr/base-feature-macros/issues
Source repo head: git clone https://github.com/hvr/base-feature-macros.git
Uploaded by HerbertValerioRiedel at 2017-05-13T08:38:44Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2028 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2017-05-13 [all 2 reports]