summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-30 17:22:28 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-10-01 22:50:12 +0000
commit1c1b7045b28d87b47b060bfb8e8ad9df34712785 (patch)
tree311f26c1ebb06c86785401ecf855cfed55792d34 /src/include
parentEnd fix bug bug:#1769679 #18; Crash when opening file with live path effect (diff)
downloadinkscape-1c1b7045b28d87b47b060bfb8e8ad9df34712785.tar.gz
inkscape-1c1b7045b28d87b47b060bfb8e8ad9df34712785.zip
Move GTKMM_CHECK_VERSION from config.h to it's own header
Avoids having to recompile most of the Inkscape codebase whenever gtkmm is updated.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/CMakeLists.txt5
-rw-r--r--src/include/gtkmm_version.h41
2 files changed, 46 insertions, 0 deletions
diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt
new file mode 100644
index 000000000..7a089b86c
--- /dev/null
+++ b/src/include/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(include_SRC
+ gtkmm_version.h
+)
+
+add_inkscape_source("${io_SRC}")
diff --git a/src/include/gtkmm_version.h b/src/include/gtkmm_version.h
new file mode 100644
index 000000000..a0078dfae
--- /dev/null
+++ b/src/include/gtkmm_version.h
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * macro for checking gtkmm version
+ *//*
+ * Authors:
+ * Patrick Storz <eduard.braun2@gmx.de>
+ *
+ * Copyright (C) 2018 Authors
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef SEEN_GTKMM_VERSION
+#define SEEN_GTKMM_VERSION
+
+#include <gtkmmconfig.h>
+
+#if !defined(GTKMM_MAJOR_VERSION) || !defined(GTKMM_MINOR_VERSION) || !defined(GTKMM_MICRO_VERSION)
+ #error "Missing defines for gtkmm version (GTKMM_MAJOR_VERSION / GTKMM_MINOR_VERSION / GTKMM_MICRO_VERSION)"
+#endif
+
+/**
+ * Check GtkMM version
+ *
+ * This is adapted from the upstream Gtk+ macro for use with GtkMM
+ *
+ * @major: major version (e.g. 1 for version 1.2.5)
+ * @minor: minor version (e.g. 2 for version 1.2.5)
+ * @micro: micro version (e.g. 5 for version 1.2.5)
+ *
+ * Returns %TRUE if the version of the GTK+ header files
+ * is the same as or newer than the passed-in version.
+ *
+ * Returns: %TRUE if GTK+ headers are new enough
+ */
+#define GTKMM_CHECK_VERSION(major,minor,micro) \
+ (GTKMM_MAJOR_VERSION > (major) || \
+ (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION > (minor)) || \
+ (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION == (minor) && \
+ GTKMM_MICRO_VERSION >= (micro)))
+
+#endif // SEEN_GTKMM_VERSION