[dconf/wip/lantw/use-weak-symbols-in-gvdb: 64/64] build: Define GVDB_USE_WEAK_SYMBOLS to use weak bindings in gvdb



commit 46a33a077d1519dcab558841b076e6fbac6e84d9
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Sun Oct 21 12:31:47 2018 +0800

    build: Define GVDB_USE_WEAK_SYMBOLS to use weak bindings in gvdb
    
    Fix linking with LLD by using weak symbols in gvdb, and update dconf
    code to make it compatible with gvdb upstream changes.
    
    Fixes https://gitlab.gnome.org/GNOME/dconf/issues/47

 gvdb/meson.build           |  1 +
 service/dconf-gvdb-utils.c |  4 ++--
 tests/dconf-mock-gvdb.c    |  2 +-
 tests/gvdb.c               | 12 ++++++------
 4 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gvdb/meson.build b/gvdb/meson.build
index 1a1aba8..6b98825 100644
--- a/gvdb/meson.build
+++ b/gvdb/meson.build
@@ -10,6 +10,7 @@ gvdb_deps = [
 cflags = [
   '-DG_LOG_DOMAIN="gvdb (via dconf)"',
   '-DG_LOG_USE_STRUCTURED=1',
+  '-DGVDB_USE_WEAK_SYMBOLS',
 ]
 
 libgvdb = static_library(
diff --git a/service/dconf-gvdb-utils.c b/service/dconf-gvdb-utils.c
index 93a4719..d77ae97 100644
--- a/service/dconf-gvdb-utils.c
+++ b/service/dconf-gvdb-utils.c
@@ -102,8 +102,8 @@ dconf_gvdb_utils_read_and_back_up_file (const gchar  *filename,
   if (table != NULL)
     {
       gchar **names;
-      gint n_names;
-      gint i;
+      gsize n_names;
+      gsize i;
 
       names = gvdb_table_get_names (table, &n_names);
       for (i = 0; i < n_names; i++)
diff --git a/tests/dconf-mock-gvdb.c b/tests/dconf-mock-gvdb.c
index 4f58de1..174bd71 100644
--- a/tests/dconf-mock-gvdb.c
+++ b/tests/dconf-mock-gvdb.c
@@ -170,7 +170,7 @@ gvdb_table_list (GvdbTable   *table,
 
 gchar **
 gvdb_table_get_names (GvdbTable *table,
-                      gint      *length)
+                      gsize     *length)
 {
   if (length)
     *length = 0;
diff --git a/tests/gvdb.c b/tests/gvdb.c
index d054067..765f4b8 100644
--- a/tests/gvdb.c
+++ b/tests/gvdb.c
@@ -35,8 +35,8 @@ test_reader_empty (void)
   GError *error = NULL;
   GvdbTable *table;
   gchar **names;
-  gint n_names;
-  gint i;
+  gsize n_names;
+  gsize i;
 
   table = gvdb_table_new (SRCDIR "/gvdbs/empty_gvdb", TRUE, &error);
   g_assert_no_error (error);
@@ -85,7 +85,7 @@ verify_table (GvdbTable *table)
 {
   GVariant *value;
   gchar **list;
-  gint n_names;
+  gsize n_names;
   gboolean has;
 
   /* We could not normally expect these to be in a particular order but
@@ -221,7 +221,7 @@ test_nested (void)
   GvdbTable *table;
   GvdbTable *locks;
   gchar **names;
-  gint n_names;
+  gsize n_names;
   gboolean has;
 
   table = gvdb_table_new (SRCDIR "/gvdbs/nested_gvdb", TRUE, &error);
@@ -277,8 +277,8 @@ inspect_carefully (GvdbTable *table,
   };
   gint found_items;
   gchar **names;
-  gint n_names;
-  gint i;
+  gsize n_names;
+  gsize i;
 
   if (level > 100)
     return;


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