# HG changeset patch
# Node ID 333c742cfb59585fa9e3abaa52e3b3cc29540f12
# Parent  af031f239f83cf66785cf63358f30597d4c2237b
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -31,13 +31,13 @@
 conf.set_quoted('VERSION', meson.project_version())
 conf.set_quoted('DISPLAY_VERSION', meson.project_version())
 
-version_conf = configuration_data()
-version_conf.set('TRAVERSITY_MAJOR_VERSION', traversity_major_version)
-version_conf.set('TRAVERSITY_MINOR_VERSION', traversity_minor_version)
-version_conf.set('TRAVERSITY_MICRO_VERSION', traversity_micro_version)
-version_conf.set('TRAVERSITY_EXTRA_VERSION', traversity_extra_version)
-version_conf.set('TRAVERSITY_VERSION', meson.project_version())
-version_conf.set('TRAVERSITY_API_VERSION', traversity_soversion)
+version_config = configuration_data()
+version_config.set('TRAVERSITY_MAJOR_VERSION', traversity_major_version)
+version_config.set('TRAVERSITY_MINOR_VERSION', traversity_minor_version)
+version_config.set('TRAVERSITY_MICRO_VERSION', traversity_micro_version)
+version_config.set('TRAVERSITY_EXTRA_VERSION', traversity_extra_version)
+version_config.set('TRAVERSITY_VERSION', meson.project_version())
+version_config.set('TRAVERSITY_API_VERSION', traversity_soversion)
 
 ###############################################################################
 # Gettext
diff --git a/traversity/meson.build b/traversity/meson.build
--- a/traversity/meson.build
+++ b/traversity/meson.build
@@ -2,12 +2,14 @@
 	'traversitycore.c',
 	'traversitydiscoverer.c',
 	'traversityupnpdiscoverer.c',
+	'traversityversion.c',
 ]
 
 TRAVERSITY_HEADERS = [
 	'traversitycore.h',
 	'traversitydiscoverer.h',
 	'traversityupnpdiscoverer.h',
+	'traversityversion.h',
 ]
 
 TRAVERSITY_ENUM_HEADERS = [
@@ -35,9 +37,11 @@
 traversity_include_base = traversity_filebase / 'traversity'
 
 TRAVERSITY_ENUMS = gnome.mkenums_simple('traversityenums',
-    sources : TRAVERSITY_ENUM_HEADERS,
-    install_header : true,
-    install_dir : get_option('includedir') / traversity_include_base)
+	decorator : '_TRAVERSITY_EXTERN',
+	header_prefix : '#include "traversityversion.h"',
+	sources : TRAVERSITY_ENUM_HEADERS,
+	install_header : true,
+	install_dir : get_option('includedir') / traversity_include_base)
 TRAVERSITY_BUILT_SOURCES += TRAVERSITY_ENUMS[0]
 TRAVERSITY_BUILT_HEADERS += TRAVERSITY_ENUMS[1]
 
@@ -57,6 +61,14 @@
 	install_dir : get_option('includedir') / traversity_filebase)
 TRAVERSITY_BUILT_HEADERS += traversity_h
 
+traversity_version_consts_h = configure_file(
+  input : 'traversityversionconsts.h.in',
+  output : 'traversityversionconsts.h',
+  configuration : version_config,
+  install : true,
+  install_dir : get_option('includedir') / 'traversity-1.0' / 'traversity')
+TRAVERSITY_BUILT_HEADERS += traversity_version_consts_h
+
 traversity_resources = gnome.compile_resources('traversityresources',
 	'resources/traversity.gresource.xml',
 	source_dir : 'resources',
@@ -77,6 +89,7 @@
 	TRAVERSITY_ALL_SOURCES,
 	dependencies : TRAVERSITY_DEPENDENCIES,
 	c_args : TRAVERSITY_CFLAGS,
+	gnu_symbol_visibility : 'hidden',
 	version : LIBTRAVERSITY_VERSION,
 	include_directories : [toplevel_inc, traversity_inc],
 )
diff --git a/traversity/reference/meson.build b/traversity/reference/meson.build
--- a/traversity/reference/meson.build
+++ b/traversity/reference/meson.build
@@ -4,7 +4,7 @@
 	traversity_toml = configure_file(
 		input : 'traversity.toml.in',
 		output : 'traversity.toml',
-		configuration : version_conf,
+		configuration : version_config,
 		install : true,
 		install_dir : docs_dir / 'traversity',
 	)
diff --git a/traversity/traversitycore.h b/traversity/traversitycore.h
--- a/traversity/traversitycore.h
+++ b/traversity/traversitycore.h
@@ -28,6 +28,8 @@
 
 #include <glib.h>
 
+#include "traversityversion.h"
+
 /**
  * TRAVERSITY_DOMAIN:
  *
@@ -59,6 +61,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_core_init(TraversityCoreFlags flags);
 
 /**
@@ -68,6 +71,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_core_uninit(void);
 
 /**
@@ -81,6 +85,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GList *traversity_core_get_all_local_ips(GError **error);
 
 G_END_DECLS
diff --git a/traversity/traversitydiscoverer.h b/traversity/traversitydiscoverer.h
--- a/traversity/traversitydiscoverer.h
+++ b/traversity/traversitydiscoverer.h
@@ -31,6 +31,8 @@
 
 #include <gio/gio.h>
 
+#include "traversityversion.h"
+
 G_BEGIN_DECLS
 
 /**
@@ -65,6 +67,8 @@
  */
 
 #define TRAVERSITY_TYPE_DISCOVERER (traversity_discoverer_get_type())
+
+TRAVERSITY_AVAILABLE_IN_0_1
 G_DECLARE_DERIVABLE_TYPE(TraversityDiscoverer, traversity_discoverer,
                          TRAVERSITY, DISCOVERER, GObject)
 
@@ -92,6 +96,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_discover(TraversityDiscoverer *discoverer);
 
 /**
@@ -108,6 +113,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_update_status(TraversityDiscoverer *discoverer, TraversityDiscovererStatus status, GError *error);
 
 /**
@@ -120,6 +126,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 TraversityDiscovererStatus traversity_discoverer_get_status(TraversityDiscoverer *discoverer);
 
 /**
@@ -134,6 +141,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GError *traversity_discoverer_get_error(TraversityDiscoverer *discoverer);
 
 /**
@@ -149,6 +157,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GInetAddress *traversity_discoverer_get_local_ipv4(TraversityDiscoverer *discoverer);
 
 /**
@@ -162,6 +171,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_set_local_ipv4(TraversityDiscoverer *discoverer, GInetAddress *local_ipv4);
 
 /**
@@ -177,6 +187,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GInetAddress *traversity_discoverer_get_local_ipv6(TraversityDiscoverer *discoverer);
 
 /**
@@ -190,6 +201,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_set_local_ipv6(TraversityDiscoverer *discoverer, GInetAddress *local_ipv6);
 
 /**
@@ -205,6 +217,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GInetAddress *traversity_discoverer_get_public_ipv4(TraversityDiscoverer *discoverer);
 
 /**
@@ -218,6 +231,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_set_public_ipv4(TraversityDiscoverer *discoverer, GInetAddress *public_ipv4);
 
 /**
@@ -233,6 +247,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 GInetAddress *traversity_discoverer_get_public_ipv6(TraversityDiscoverer *discoverer);
 
 /**
@@ -246,6 +261,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 void traversity_discoverer_set_public_ipv6(TraversityDiscoverer *discoverer, GInetAddress *public_ipv6);
 
 G_END_DECLS
diff --git a/traversity/traversityupnpdiscoverer.h b/traversity/traversityupnpdiscoverer.h
--- a/traversity/traversityupnpdiscoverer.h
+++ b/traversity/traversityupnpdiscoverer.h
@@ -29,7 +29,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include <traversity/traversitydiscoverer.h>
+#include "traversitydiscoverer.h"
+#include "traversityversion.h"
 
 G_BEGIN_DECLS
 
@@ -42,6 +43,8 @@
  */
 
 #define TRAVERSITY_TYPE_UPNP_DISCOVERER (traversity_upnp_discoverer_get_type())
+
+TRAVERSITY_AVAILABLE_IN_0_1
 G_DECLARE_FINAL_TYPE(TraversityUpnpDiscoverer, traversity_upnp_discoverer,
                      TRAVERSITY, UPNP_DISCOVERER, TraversityDiscoverer)
 
@@ -55,6 +58,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 TraversityDiscoverer *traversity_upnp_discoverer_new(void);
 
 /**
@@ -69,6 +73,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 TraversityDiscoverer *traversity_upnp_discoverer_new_custom(const char *host_address, int host_port);
 
 /**
@@ -81,6 +86,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 const char *traversity_upnp_discoverer_get_host_address(TraversityUpnpDiscoverer *upnp);
 
 /**
@@ -93,6 +99,7 @@
  *
  * Since: 0.1
  */
+TRAVERSITY_AVAILABLE_IN_0_1
 int traversity_upnp_discoverer_get_host_port(TraversityUpnpDiscoverer *upnp);
 
 G_END_DECLS
diff --git a/traversity/traversityversion.c b/traversity/traversityversion.c
new file mode 100644
--- /dev/null
+++ b/traversity/traversityversion.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2022-2025 Traversity Developers
+ *
+ * Traversity is the legal property of its developers, whose names are too
+ * numerous to list here. Please refer to the AUTHORS file distributed
+ * with this source distribution
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "traversityversion.h"
+
+/******************************************************************************
+ * Externals
+ *****************************************************************************/
+const guint traversity_major_version = TRAVERSITY_MAJOR_VERSION;
+const guint traversity_minor_version = TRAVERSITY_MINOR_VERSION;
+const guint traversity_micro_version = TRAVERSITY_MICRO_VERSION;
+const char *traversity_version = TRAVERSITY_VERSION;
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+const char *
+traversity_check_version(guint required_major, guint required_minor,
+                         guint required_micro)
+{
+	if(required_major > TRAVERSITY_MAJOR_VERSION) {
+		return "traversity version too old (major mismatch)";
+	}
+
+#if TRAVERSITY_CHECK_VERSION(1, 0, 0)
+	if(required_major < TRAVERSITY_MAJOR_VERSION) {
+		return "traversity version too new (major mismatch)";
+	}
+#endif
+
+	if(required_minor > TRAVERSITY_MINOR_VERSION) {
+		return "traversity version too old (minor mismatch)";
+	}
+
+	if((required_minor == TRAVERSITY_MINOR_VERSION) &&
+	   (required_micro > TRAVERSITY_MICRO_VERSION))
+	{
+		return "traversity version too old (micro mismatch)";
+	}
+
+	return NULL;
+}
diff --git a/traversity/traversityversion.h b/traversity/traversityversion.h
new file mode 100644
--- /dev/null
+++ b/traversity/traversityversion.h
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2022-2025 Traversity Developers
+ *
+ * Traversity is the legal property of its developers, whose names are too
+ * numerous to list here. Please refer to the AUTHORS file distributed
+ * with this source distribution
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef TRAVERSITY_VERSION_H
+#define TRAVERSITY_VERSION_H
+
+#include <glib.h>
+
+#include "traversityversionconsts.h"
+
+/* clang-format tries to remove the space after 'if', which confuses
+ * gobject-introspection, so turn it off temporarily. */
+/* clang-format off */
+#if (defined(_WIN32) || defined(__CYGWIN__)) && \
+	!defined(TRAVERSITY_STATIC_COMPILATION)
+/* clang-format on */
+#define _TRAVERSITY_EXPORT __declspec(dllexport)
+#define _TRAVERSITY_IMPORT __declspec(dllimport)
+#elif __GNUC__ >= 4
+#define _TRAVERSITY_EXPORT __attribute__((visibility("default")))
+#define _TRAVERSITY_IMPORT
+#else
+#define _TRAVERSITY_EXPORT
+#define _TRAVERSITY_IMPORT
+#endif
+#ifdef TRAVERSITY_COMPILATION
+#define _TRAVERSITY_API _TRAVERSITY_EXPORT
+#else
+#define _TRAVERSITY_API _TRAVERSITY_IMPORT
+#endif
+
+#define _TRAVERSITY_EXTERN _TRAVERSITY_API extern
+
+#ifdef TRAVERSITY_DISABLE_DEPRECATION_WARNINGS
+#define TRAVERSITY_DEPRECATED _TRAVERSITY_EXTERN
+#define TRAVERSITY_DEPRECATED_FOR(f) _TRAVERSITY_EXTERN
+#define TRAVERSITY_UNAVAILABLE(maj, min) _TRAVERSITY_EXTERN
+#define TRAVERSITY_UNAVAILABLE_MACRO(maj, min)
+#define TRAVERSITY_UNAVAILABLE_STATIC_INLINE(maj, min)
+#define TRAVERSITY_UNAVAILABLE_TYPE(maj, min)
+#else
+#define TRAVERSITY_DEPRECATED G_DEPRECATED _TRAVERSITY_EXTERN
+#define TRAVERSITY_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _TRAVERSITY_EXTERN
+#define TRAVERSITY_UNAVAILABLE(maj, min) G_UNAVAILABLE(maj, min) _TRAVERSITY_EXTERN
+#define TRAVERSITY_UNAVAILABLE_MACRO(maj, min) G_UNAVAILABLE_MACRO(maj, min)
+#define TRAVERSITY_UNAVAILABLE_STATIC_INLINE(maj, min) G_UNAVAILABLE(maj, min)
+#define TRAVERSITY_UNAVAILABLE_TYPE(maj, min) G_UNAVAILABLE(maj, min)
+#endif
+
+/**
+ * TRAVERSITY_VERSION_MIN_REQUIRED:
+ *
+ * A macro that should be defined by the user prior to including the
+ * `traversity.h` header.
+ *
+ * The definition should be one of the predefined Traversity version macros:
+ * %TRAVERSITY_VERSION_0_1, %TRAVERSITY_VERSION_0_2, ...
+ *
+ * This macro defines the earliest version of Traversity that the package is
+ * required to be able to compile against.
+ *
+ * If the compiler is configured to warn about the use of deprecated functions,
+ * then using functions that were deprecated in version
+ * %TRAVERSITY_VERSION_MIN_REQUIRED or earlier will cause warnings (but using
+ * functions deprecated in later releases will not).
+ *
+ * Since: 0.1
+ */
+
+/**
+ * TRAVERSITY_VERSION_CUR_STABLE:
+ *
+ * A macro that evaluates to the current stable version of traversity, in a
+ * format that can be used by the C pre-processor.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_VERSION_CUR_STABLE \
+	(G_ENCODE_VERSION(TRAVERSITY_MAJOR_VERSION, TRAVERSITY_MINOR_VERSION))
+
+/* If the package sets TRAVERSITY_VERSION_MIN_REQUIRED to some future
+ * TRAVERSITY_VERSION_X_Y value that we don't know about, it will compare as 0
+ * in preprocessor tests.
+ */
+#ifndef TRAVERSITY_VERSION_MIN_REQUIRED
+#define TRAVERSITY_VERSION_MIN_REQUIRED (TRAVERSITY_VERSION_CUR_STABLE)
+#elif TRAVERSITY_VERSION_MIN_REQUIRED == 0
+#undef TRAVERSITY_VERSION_MIN_REQUIRED
+#define TRAVERSITY_VERSION_MIN_REQUIRED (TRAVERSITY_VERSION_CUR_STABLE + 1)
+#endif /* TRAVERSITY_VERSION_MIN_REQUIRED */
+
+#if !defined(TRAVERSITY_VERSION_MAX_ALLOWED) || (TRAVERSITY_VERSION_MAX_ALLOWED == 0)
+#undef TRAVERSITY_VERSION_MAX_ALLOWED
+#define TRAVERSITY_VERSION_MAX_ALLOWED (TRAVERSITY_VERSION_CUR_STABLE)
+#endif /* TRAVERSITY_VERSION_MAX_ALLOWED */
+
+/* sanity checks */
+#if TRAVERSITY_VERSION_MIN_REQUIRED > TRAVERSITY_VERSION_CUR_STABLE
+#error "TRAVERSITY_VERSION_MIN_REQUIRED must be <= TRAVERSITY_VERSION_CUR_STABLE"
+#endif
+#if TRAVERSITY_VERSION_MAX_ALLOWED < TRAVERSITY_VERSION_MIN_REQUIRED
+#error "TRAVERSITY_VERSION_MAX_ALLOWED must be >= TRAVERSITY_VERSION_MIN_REQUIRED"
+#endif
+#if TRAVERSITY_VERSION_MIN_REQUIRED < G_ENCODE_VERSION(0, 1)
+#error "TRAVERSITY_VERSION_MIN_REQUIRED must be >= TRAVERSITY_VERSION_0_1"
+#endif
+
+#define TRAVERSITY_VAR _TRAVERSITY_EXTERN
+#define TRAVERSITY_AVAILABLE_IN_ALL _TRAVERSITY_EXTERN
+
+/**
+ * TRAVERSITY_VERSION_0_1:
+ *
+ * A macro that evaluates to the 0.1 version of traversity, in a format that
+ * can be used by the C pre-processor.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_VERSION_0_1 (G_ENCODE_VERSION(0, 1))
+
+#if TRAVERSITY_VERSION_MAX_ALLOWED < TRAVERSITY_VERSION_0_1
+#define TRAVERSITY_AVAILABLE_IN_0_1 TRAVERSITY_UNAVAILABLE(0, 1)
+#define TRAVERSITY_AVAILABLE_ENUMERATOR_IN_0_1 TRAVERSITY_UNAVAILABLE_ENUMERATOR(0, 1)
+#define TRAVERSITY_AVAILABLE_MACRO_IN_0_1 TRAVERSITY_UNAVAILABLE_MACRO(0, 1)
+#define TRAVERSITY_AVAILABLE_STATIC_INLINE_IN_0_1 TRAVERSITY_UNAVAILABLE_STATIC_INLINE(0, 1)
+#define TRAVERSITY_AVAILABLE_TYPE_IN_0_1 TRAVERSITY_UNAVAILABLE_TYPE(0, 1)
+#else
+#define TRAVERSITY_AVAILABLE_IN_0_1 _TRAVERSITY_EXTERN
+#define TRAVERSITY_AVAILABLE_ENUMERATOR_IN_0_1
+#define TRAVERSITY_AVAILABLE_MACRO_IN_0_1
+#define TRAVERSITY_AVAILABLE_STATIC_INLINE_IN_0_1
+#define TRAVERSITY_AVAILABLE_TYPE_IN_0_1
+#endif
+
+G_BEGIN_DECLS
+
+/**
+ * TRAVERSITY_CHECK_VERSION:
+ * @major: The major version to check for.
+ * @minor: The minor version to check for.
+ * @micro: The micro version to check for.
+ *
+ * Checks the version of traversity being compiled against. See
+ * [func@check_version] for a runtime check.
+ *
+ * Returns: %TRUE if the version is the same or newer than the passed-in
+ *          version.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_CHECK_VERSION(major, minor, micro) ((major) == TRAVERSITY_MAJOR_VERSION && \
+                                                 ((minor) < TRAVERSITY_MINOR_VERSION || \
+                                                  ((minor) == TRAVERSITY_MINOR_VERSION && (micro) <= TRAVERSITY_MICRO_VERSION)))
+
+/**
+ * traversity_check_version:
+ * @required_major: the required major version.
+ * @required_minor: the required minor version.
+ * @required_micro: the required micro version.
+ *
+ * Checks that the traversity version is compatible with the requested version.
+ *
+ * Returns: %NULL if the versions are compatible, or a string describing
+ *          the version mismatch if not compatible.
+ *
+ * Since: 0.1
+ */
+TRAVERSITY_AVAILABLE_IN_ALL
+const char *traversity_check_version(guint required_major, guint required_minor, guint required_micro);
+
+/**
+ * traversity_version:
+ *
+ * The full version string of the running traversity.
+ *
+ * Since: 0.1
+ */
+TRAVERSITY_VAR const char *traversity_version;
+
+/**
+ * traversity_major_version:
+ *
+ * The major version of the running traversity. Contrast with
+ * #TRAVERSITY_MAJOR_VERSION, which expands at compile time to the major
+ * version of traversity being compiled against.
+ *
+ * Since: 0.1
+ */
+TRAVERSITY_VAR const guint traversity_major_version;
+
+/**
+ * traversity_minor_version:
+ *
+ * The minor version of the running traversity. Contrast with
+ * #TRAVERSITY_MINOR_VERSION, which expands at compile time to the minor
+ * version of traversity being compiled against.
+ *
+ * Since: 0.1
+ */
+TRAVERSITY_VAR const guint traversity_minor_version;
+
+/**
+ * traversity_micro_version:
+ *
+ * The micro version of the running traversity. Contrast with
+ * #TRAVERSITY_MICRO_VERSION, which expands at compile time to the micro
+ * version of traversity being compiled against.
+ *
+ * Since: 0.1
+ */
+TRAVERSITY_VAR const guint traversity_micro_version;
+
+G_END_DECLS
+
+#endif /* TRAVERSITY_VERSION_H */
diff --git a/traversity/traversityversionconsts.h.in b/traversity/traversityversionconsts.h.in
new file mode 100644
--- /dev/null
+++ b/traversity/traversityversionconsts.h.in
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2022-2025 Traversity Developers
+ *
+ * Traversity is the legal property of its developers, whose names are too
+ * numerous to list here. Please refer to the AUTHORS file distributed
+ * with this source distribution
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef TRAVERSITY_VERSION_CONSTS_H
+#define TRAVERSITY_VERSION_CONSTS_H
+
+/**
+ * TRAVERSITY_MAJOR_VERSION:
+ *
+ * The major version of the version of Traversity that was compiled against.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_MAJOR_VERSION (@TRAVERSITY_MAJOR_VERSION@)
+
+/**
+ * TRAVERSITY_MINOR_VERSION:
+ *
+ * The minor version of the version of Traversity that was compiled against.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_MINOR_VERSION (@TRAVERSITY_MINOR_VERSION@)
+
+/**
+ * TRAVERSITY_MICRO_VERSION:
+ *
+ * The micro version of the version of Traversity that was compiled against.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_MICRO_VERSION (@TRAVERSITY_MICRO_VERSION@)
+
+/**
+ * TRAVERSITY_EXTRA_VERSION:
+ *
+ * The extra version of the version of Traversity that was compiled against.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_EXTRA_VERSION ("@TRAVERSITY_EXTRA_VERSION@")
+
+/**
+ * TRAVERSITY_VERSION:
+ *
+ * The full version number for the version of Traversity that was compiled against.
+ *
+ * Since: 0.1
+ */
+#define TRAVERSITY_VERSION ("@TRAVERSITY_VERSION@")
+
+#endif /* TRAVERSITY_VERSION_CONSTS_H */
