commit e2ed9eb693658f2c19d9cfe61a104f47e48df7ff
parent 5b07d6cbbe2b8d21d6372d2cde440b5b722ab21a
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Mon, 2 Jan 2023 09:41:14 +0100
Merge remote-tracking branch 'free-audio/main' into preset-discovery
Diffstat:
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/ChangeLog.md b/ChangeLog.md
@@ -1,3 +1,8 @@
+# Changes in 1.1.6
+
+* [version.h](include/clap/version.h) `CLAP_VERSION_LT` was backwards (comparing current with arg
+ vs arg with current). Correct and enhance tests.
+
# Changes in 1.1.5
* [plugin.h](include/clap/plugin.h): clarify plugin state after init()
diff --git a/include/clap/version.h b/include/clap/version.h
@@ -22,14 +22,14 @@ typedef struct clap_version {
#define CLAP_VERSION_MAJOR 1
#define CLAP_VERSION_MINOR 1
-#define CLAP_VERSION_REVISION 5
+#define CLAP_VERSION_REVISION 6
#define CLAP_VERSION_INIT \
{ (uint32_t)CLAP_VERSION_MAJOR, (uint32_t)CLAP_VERSION_MINOR, (uint32_t)CLAP_VERSION_REVISION }
-#define CLAP_VERSION_LT(maj,min,rev) (((maj) < CLAP_VERSION_MAJOR) || \
- ((maj) == CLAP_VERSION_MAJOR && (min) < CLAP_VERSION_MINOR ) || \
- ((maj) == CLAP_VERSION_MAJOR && (min) == CLAP_VERSION_MINOR && (rev) < CLAP_VERSION_REVISION))
+#define CLAP_VERSION_LT(maj,min,rev) ((CLAP_VERSION_MAJOR < (maj)) || \
+ ((maj) == CLAP_VERSION_MAJOR && CLAP_VERSION_MINOR < (min)) || \
+ ((maj) == CLAP_VERSION_MAJOR && (min) == CLAP_VERSION_MINOR && CLAP_VERSION_REVISION < (rev)))
#define CLAP_VERSION_EQ(maj,min,rev) (((maj) == CLAP_VERSION_MAJOR) && ((min) == CLAP_VERSION_MINOR) && ((rev) == CLAP_VERSION_REVISION))
#define CLAP_VERSION_GE(maj,min,rev) (!CLAP_VERSION_LT(maj,min,rev))
diff --git a/src/main.cc b/src/main.cc
@@ -28,6 +28,26 @@
#error CLAP_VERSION_GE was inroduced in 1.1.5 so we should be later than that version.
#endif
+#if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR + 1, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION)
+#error CLAP_VERSION_LT is inconsistent (MAJOR)
+#endif
+#if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR + 1, CLAP_VERSION_REVISION)
+#error CLAP_VERSION_LT is inconsistent (MINOR)
+#endif
+#if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION + 1)
+#error CLAP_VERSION_LT is inconsistent (REVISION)
+#endif
+
+#if CLAP_VERSION_LT(CLAP_VERSION_MAJOR - 1, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION)
+#error CLAP_VERSION_LT is inconsistent (MAJOR)
+#endif
+#if CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR - 1, CLAP_VERSION_REVISION)
+#error CLAP_VERSION_LT is inconsistent (MINOR)
+#endif
+#if CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION - 1)
+#error CLAP_VERSION_LT is inconsistent (REVISION)
+#endif
+
static const CLAP_CONSTEXPR clap_version m = CLAP_VERSION;
int main(int, char **) {