summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-05-01 07:00:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-05-01 07:00:44 +0200
commit5e8f2c7e0357b770adee8a46801fa7dd2dedb94c (patch)
tree8b63e370cd3c59ef460542da96369b9e0457e484 /odb
parentcfeda89f300b23dcf95abb431bd54020b6a27a53 (diff)
Go back to comparing compiler/runtime interface versions
Diffstat (limited to 'odb')
-rw-r--r--odb/odb/generator.cxx4
-rw-r--r--odb/odb/odb.cxx9
-rw-r--r--odb/odb/version.hxx.in4
3 files changed, 17 insertions, 0 deletions
diff --git a/odb/odb/generator.cxx b/odb/odb/generator.cxx
index 6348234..f0b92ab 100644
--- a/odb/odb/generator.cxx
+++ b/odb/odb/generator.cxx
@@ -519,8 +519,12 @@ generate (options const& ops,
//
hxx << "#include <odb/version.hxx>" << endl
<< endl
+#if 1
+ << "#if ODB_VERSION != " << ODB_VERSION << "UL" << endl
+#else
<< "#if LIBODB_VERSION_FULL != " << ODB_COMPILER_VERSION << "ULL || \\" << endl
<< " LIBODB_SNAPSHOT != " << ODB_COMPILER_SNAPSHOT << "ULL" << endl
+#endif
<< "#error ODB runtime version mismatch" << endl
<< "#endif" << endl
<< endl;
diff --git a/odb/odb/odb.cxx b/odb/odb/odb.cxx
index 2f2a75d..9899262 100644
--- a/odb/odb/odb.cxx
+++ b/odb/odb/odb.cxx
@@ -955,10 +955,19 @@ main (int argc, char* argv[])
// version is a pre-release but having it always won't hurt (it
// will be 0 for final versions).
//
+ // After some experience with requiring the exact version match we
+ // found it just too tedious and went back to only comparing the
+ // interface version (we could support both with an option; see
+ // also similar code in generator.cxx).
+ //
os << "#include <odb/version.hxx>" << endl
<< endl
+#if 1
+ << "#if ODB_VERSION != " << ODB_VERSION << "UL" << endl
+#else
<< "#if LIBODB_VERSION_FULL != " << ODB_COMPILER_VERSION << "ULL"
" || LIBODB_SNAPSHOT != " << ODB_COMPILER_SNAPSHOT << "ULL" << endl
+#endif
<< "# error incompatible ODB compiler and runtime " <<
"versions" << endl
<< "#endif" << endl
diff --git a/odb/odb/version.hxx.in b/odb/odb/version.hxx.in
index a131c03..2bf2ae7 100644
--- a/odb/odb/version.hxx.in
+++ b/odb/odb/version.hxx.in
@@ -47,4 +47,8 @@
//
#define ODB_COMPILER_VERSION_OLD 2049976
+// ODB interface version: minor, major, and alpha/beta versions.
+//
+#define ODB_VERSION 20476
+
#endif // ODB_COMPILER_VERSION