[librsvg: 2/9] Change version constants to use the rsvg namespace




commit 6e5384e72eae9f142fbae0765858dda2959ec7b1
Author: Sven Neumann <sven svenfoo org>
Date:   Fri Sep 18 19:01:02 2020 +0200

    Change version constants to use the rsvg namespace
    
    It turned out that due to libtool filtering of exported symbols the
    constants with librsvg_ prefix never ended up in the library. So we
    change the variable now to use the rsvg_ prefix like all other symbols.
    
    This fixes the new test and makes the compile-time version constants
    actually useable from language bindings.

 librsvg/librsvg-features.c    | 24 ++++++++++++++++--------
 librsvg/librsvg-features.h.in |  8 ++++----
 tests/api.c                   |  4 ++--
 3 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/librsvg/librsvg-features.c b/librsvg/librsvg-features.c
index 07c4fd8d..1d25611c 100644
--- a/librsvg/librsvg-features.c
+++ b/librsvg/librsvg-features.c
@@ -1,32 +1,40 @@
 #include "rsvg.h"
 
 /**
- * librsvg_major_version:
+ * rsvg_major_version:
  *
  * Major version of the library.  For example, for version 2.3.4, the major
  * version will be 2.
+ *
+ * Since: 2.52
  */
-const guint librsvg_major_version = LIBRSVG_MAJOR_VERSION;
+const guint rsvg_major_version = LIBRSVG_MAJOR_VERSION;
 
 /**
- * librsvg_minor_version:
+ * rsvg_minor_version:
  *
  * Minor version of the library.  For example, for version 2.3.4, the minor
  * version will be 3.
+ *
+ * Since: 2.52
  */
-const guint librsvg_minor_version = LIBRSVG_MINOR_VERSION;
+const guint rsvg_minor_version = LIBRSVG_MINOR_VERSION;
 
 /**
- * librsvg_micro_version:
+ * rsvg_micro_version:
  *
  * Micro version of the library.  For example, for version 2.3.4, the micro
  * version will be 4.
+ *
+ * Since: 2.52
  */
-const guint librsvg_micro_version = LIBRSVG_MICRO_VERSION;
+const guint rsvg_micro_version = LIBRSVG_MICRO_VERSION;
 
 /**
- * librsvg_version:
+ * rsvg_version:
  *
  * String with the library version.  For example, "<literal>2.3.4</literal>".
+ *
+ * Since: 2.52
  */
-const char librsvg_version[] = LIBRSVG_VERSION;
+const char rsvg_version[] = LIBRSVG_VERSION;
diff --git a/librsvg/librsvg-features.h.in b/librsvg/librsvg-features.h.in
index 7a288f5b..e276ea6b 100644
--- a/librsvg/librsvg-features.h.in
+++ b/librsvg/librsvg-features.h.in
@@ -47,9 +47,9 @@
 #endif /* __GTK_DOC_IGNORE__ */
 
 
-RSVG_VAR const guint librsvg_major_version;
-RSVG_VAR const guint librsvg_minor_version;
-RSVG_VAR const guint librsvg_micro_version;
-RSVG_VAR const char librsvg_version[];
+RSVG_VAR const guint rsvg_major_version;
+RSVG_VAR const guint rsvg_minor_version;
+RSVG_VAR const guint rsvg_micro_version;
+RSVG_VAR const char rsvg_version[];
 
 #endif
diff --git a/tests/api.c b/tests/api.c
index f062564f..7b45408a 100644
--- a/tests/api.c
+++ b/tests/api.c
@@ -1413,8 +1413,8 @@ static void
 library_version_constants (void)
 {
     gchar *version = g_strdup_printf ("%u.%u.%u",
-                                      librsvg_major_version, librsvg_minor_version, librsvg_micro_version);
-    g_assert_cmpstr (version, ==, librsvg_version);
+                                      rsvg_major_version, rsvg_minor_version, rsvg_micro_version);
+    g_assert_cmpstr (version, ==, rsvg_version);
     g_free (version);
 }
 


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