Nikos Mavrogiannopoulos nmav@gnutls.org writes:
This patch adds a definition in nettle-meta.h with nettle's version number. That way applications can be easily modified to support both the 2.7 and the 3.x API. I didn't add for hogweed because it didn't seem to make sense, the API version is fully determined by nettle only.
Sorry for the late reply. It seems reasonable to me to include the package version in some header file. However, I'm not sure nettle-meta.h is the right file.
I'd prefer either a separate file nettle/version.h, or some file like nettle-typs.h included in all other nettle headers. And if we let configure generate a header file, it makes some sense to also move the definition of NETTLE_USE_MINI_GMP there, and move back from bignum-h-in to bignum.h.
And I'm also not sure I like the way major and minor numbers are combined into a single value. Can't they be kept separate, say NETTLE_VERSION, NETTLE_MINOR_VERSION, NETTLE_PATCHLEVEL or so? What do other packages do? E.g., gcc uses
$ echo | cpp -dM -E - |grep GNUC #define __GNUC_PATCHLEVEL__ 2 #define __GNUC__ 4 #define __GNUC_MINOR__ 7
Maybe there should also be correspondingglobal symbols, so that version can be checked also at runtime?
Regards, /Niels