[libshumate/tintou/version] Version: Remove useless elements




commit 338de27cd2293fad687a90bc5ac217a416565ae5
Author: Corentin Noël <corentin noel collabora com>
Date:   Wed Sep 8 09:27:54 2021 +0200

    Version: Remove useless elements
    
    It seems that not even GTK is shipping the equivalent these days.

 meson.build                           |  3 ++-
 shumate/shumate-network-tile-source.c |  4 ++--
 shumate/shumate-version.h.in          | 45 ++++++++++-------------------------
 3 files changed, 16 insertions(+), 36 deletions(-)
---
diff --git a/meson.build b/meson.build
index 60fe8ec..e4e6b26 100644
--- a/meson.build
+++ b/meson.build
@@ -81,9 +81,10 @@ if get_option('gtk_doc')
   gidocgen = find_program('gi-docgen')
 endif
 
+add_project_arguments('-DSHUMATE_VERSION="@0@"'.format(meson.project_version()), language: 'c')
 # Configurations
 config_h = configuration_data()
-config_h.set_quoted('VERSION', version)
+config_h.set_quoted('SHUMATE_VERSION', version)
 
 configure_file(
   output: 'config.h',
diff --git a/shumate/shumate-network-tile-source.c b/shumate/shumate-network-tile-source.c
index bdc58e8..3465341 100644
--- a/shumate/shumate-network-tile-source.c
+++ b/shumate/shumate-network-tile-source.c
@@ -289,7 +289,7 @@ shumate_network_tile_source_class_init (ShumateNetworkTileSourceClass *klass)
     g_param_spec_string ("user-agent",
                          "HTTP User Agent",
                          "The HTTP user agent used for network requests",
-                         "libshumate/" SHUMATE_VERSION_S,
+                         "libshumate/" SHUMATE_VERSION,
                          G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
@@ -328,7 +328,7 @@ shumate_network_tile_source_init (ShumateNetworkTileSource *tile_source)
         NULL);
   g_object_set (G_OBJECT (priv->soup_session),
       "user-agent",
-      "libshumate/" SHUMATE_VERSION_S,
+      "libshumate/" SHUMATE_VERSION,
       "max-conns-per-host", MAX_CONNS_DEFAULT,
       "max-conns", MAX_CONNS_DEFAULT,
       NULL);
diff --git a/shumate/shumate-version.h.in b/shumate/shumate-version.h.in
index 1da5959..5c29279 100644
--- a/shumate/shumate-version.h.in
+++ b/shumate/shumate-version.h.in
@@ -52,42 +52,21 @@
  */
 #define SHUMATE_MICRO_VERSION   (@SHUMATE_MICRO_VERSION@)
 
-/**
- * SHUMATE_VERSION:
- *
- * The full version of libshumate, like 1.2.3
- */
-#define SHUMATE_VERSION         @SHUMATE_VERSION@
-
-/**
- * SHUMATE_VERSION_S:
- *
- * The full version of libshumate, in string form (suited for
- * string concatenation)
- */
-#define SHUMATE_VERSION_S       "@SHUMATE_VERSION@"
-
-/**
- * SHUMATE_VERSION_HEX:
- *
- * Numerically encoded version of libshumate, like 0x010203
- */
-#define SHUMATE_VERSION_HEX     ((SHUMATE_MAJOR_VERSION << 24) | \
-                                 (SHUMATE_MINOR_VERSION << 16) | \
-                                 (SHUMATE_MICRO_VERSION << 8))
-
 /**
  * SHUMATE_CHECK_VERSION:
- * @major: major version, like 1 in 1.2.3
- * @minor: minor version, like 2 in 1.2.3
- * @micro: micro version, like 3 in 1.2.3
+ * @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 Shumate header files
+ * is the same as or newer than the passed-in version.
  *
- * Evaluates to %TRUE if the version of libshumate is greater or equal
- * than @major, @minor and @micro
+ * Returns: %TRUE if Shumate headers are new enough
  */
-#define SHUMATE_CHECK_VERSION(major,minor,micro) \
-        (SHUMATE_MAJOR_VERSION > (major) || \
-         (SHUMATE_MAJOR_VERSION == (major) && SHUMATE_MINOR_VERSION > (minor)) || \
-         (SHUMATE_MAJOR_VERSION == (major) && SHUMATE_MINOR_VERSION == (minor) && SHUMATE_MICRO_VERSION >= 
(micro)))
+#define SHUMATE_CHECK_VERSION(major,minor,micro)                              \
+    (SHUMATE_MAJOR_VERSION > (major) ||                                       \
+     (SHUMATE_MAJOR_VERSION == (major) && SHUMATE_MINOR_VERSION > (minor)) || \
+     (SHUMATE_MAJOR_VERSION == (major) && SHUMATE_MINOR_VERSION == (minor) && \
+      SHUMATE_MICRO_VERSION >= (micro)))
 
 #endif /* __SHUMATE_VERSION_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]