aboutsummaryrefslogtreecommitdiff
path: root/src/proj.h
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-03-17 13:47:38 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-03-17 14:00:25 +0100
commit130d70228f9985a3365ca5bbc64057648134e2f7 (patch)
tree79df959c50836a9bd841f2da087e0fb7a4f55784 /src/proj.h
parent1b07ef00c55525420cfbc9467016959e709e6862 (diff)
downloadPROJ-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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/proj.h b/src/proj.h
index 08bab92b..bcc0cccb 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -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 */