diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-17 13:47:38 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-17 14:00:25 +0100 |
| commit | 130d70228f9985a3365ca5bbc64057648134e2f7 (patch) | |
| tree | 79df959c50836a9bd841f2da087e0fb7a4f55784 /src/proj.h | |
| parent | 1b07ef00c55525420cfbc9467016959e709e6862 (diff) | |
| download | PROJ-130d70228f9985a3365ca5bbc64057648134e2f7.tar.gz PROJ-130d70228f9985a3365ca5bbc64057648134e2f7.zip | |
proj.h: add PROJ_COMPUTE_VERSION, PROJ_VERSION_NUMBER, PROJ_AT_LEAST_VERSION macros
Makes it easier for users to test if they build against a PROJ version
later than a given x.y.z version.
Diffstat (limited to 'src/proj.h')
| -rw-r--r-- | src/proj.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -174,6 +174,18 @@ extern "C" { #define PROJ_VERSION_MINOR 1 #define PROJ_VERSION_PATCH 0 +/* Note: the following 3 defines have been introduced in PROJ 8.0.1 */ +/* Macro to compute a PROJ version number from its components */ +#define PROJ_COMPUTE_VERSION(maj,min,patch) ((maj)*10000+(min)*100+(patch)) + +/* Current PROJ version from the above version numbers */ +#define PROJ_VERSION_NUMBER \ + PROJ_COMPUTE_VERSION(PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH) + +/* Macro that returns true if the current PROJ version is at least the version specified by (maj,min,patch) */ +#define PROJ_AT_LEAST_VERSION(maj,min,patch) \ + (PROJ_VERSION_NUMBER >= PROJ_COMPUTE_VERSION(maj,min,patch)) + extern char const PROJ_DLL pj_release[]; /* global release id string */ /* first forward declare everything needed */ |
