A C header to help move #ifdefs out of your code
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 103 commits behind nemequ:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



HEDLEY IS NOT READY FOR USE YET. I'm posting it very early in hopes that I'll get some feedback from C developers. If you have any thougts or ideas, please use the issue tracker, or just e-mail me. If you like the idea but don't really have anything to contribute, just star the repo on GitHub so I know there is interest.


For documentation, see https://nemequ.github.io/hedley/. There is an easy-to-read user guide, and full API documentation.

Brief Description

Hedley is C a header file designed to smooth over some platform-specific annoyances. The idea is to get rid of a bunch of the #ifdefs in your code and put them in Hedley instead or, if you haven't bothered with platform-specific functionality in your code, to make it easier to do so. This code can be used to improve:

  • Static analysis — better warnings and errors help you catch errors before they become a real issue.
  • Optimizations — compiler hints help speed up your code.
  • Manage public APIs
  • Visibility — keeping internal symbols private can make your code faster and smaller.
  • Versioning — help consumers avoid functions which are deprecated or too new for all the platforms they want to support.
  • … and more!

You can safely use Hedley in your public API. If someone else includes a newer version of Hedley later on, the newer Hedley will just redefine everything, and if someone includes an older version it will simply be ignored.

It should be safe to use any of Hedley's features; if the platform doesn't support the feature it will be silently ignored.