Two primary changes based on the way include statements are handled for the project.
- Headers defined by the secp256k1 library are now imported via
#include "secp256k1.h"
. - Changes to the files that got included are based on the “include what you use” tool.
For the first point to happen, the Makefile.am got tweaked and declared the AM_CPPFLAGS
variable and included as a dependency for the different targets on the file. I do not have extensive autoconf/automake experience, so I just went with this variable and while it “works”, I am not clear if it is the best way to do it.
At any rate, within say secp256k1.c
, one can include the header in the cleaner syntax without the “include/” prefix. This also allows other external libraries and build configs to work by defining the lib’s include path as such.
The latter point makes use of the aggregate tooling built on Clang’s different tools called “include what you use”. Essentially it shows what needs to be declared/removed to include what you use.