changeset 5489:e1fa4501b4a7

Make dynamic support for GConf work again.
author andrew
date Mon, 06 Aug 2012 13:31:40 +0100
parents f46deb5db4f9
children 9e25381cbff4
files src/solaris/native/common/deps/gconf2/gconf/gconf-client.h src/solaris/native/common/deps/gconf2/gconf_fp.c src/solaris/native/common/deps/gconf2/gconf_fp.h src/solaris/native/common/deps/glib2/gio/gio_typedefs.h src/solaris/native/common/deps/glib2/gio_fp.h src/solaris/native/common/deps/glib2/glib_fp.h
diffstat 6 files changed, 49 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/common/deps/gconf2/gconf/gconf-client.h	Wed Jul 25 18:24:09 2012 +0100
+++ b/src/solaris/native/common/deps/gconf2/gconf/gconf-client.h	Mon Aug 06 13:31:40 2012 +0100
@@ -37,6 +37,5 @@
 typedef int   fp_client_get_int_func(void*, char *, void**);
 typedef int   fp_client_get_bool_func(void*, char *, void**);
 typedef int   fp_conf_init_func(int, char**, void**);
-typedef void  fp_type_init_func ();
 
 #endif
--- a/src/solaris/native/common/deps/gconf2/gconf_fp.c	Wed Jul 25 18:24:09 2012 +0100
+++ b/src/solaris/native/common/deps/gconf2/gconf_fp.c	Mon Aug 06 13:31:40 2012 +0100
@@ -32,7 +32,8 @@
 fp_client_get_int_func* my_get_int_func = NULL;
 fp_client_get_bool_func* my_get_bool_func = NULL;
 fp_conf_init_func* my_gconf_init_func = NULL;
-fp_type_init_func* my_g_type_init_func = NULL;
+type_init_func type_init = NULL;
+free_func gfree = NULL;
 
 jboolean init_gconf(int* gconf_ver, void** gconf_client)
 {
@@ -48,13 +49,14 @@
     /*
      * Now let's get pointer to the functions we need.
      */
-    my_g_type_init_func = (fp_type_init_func*) dlsym(RTLD_DEFAULT, "g_type_init");
+    type_init = (type_init_func) dlsym(RTLD_DEFAULT, "g_type_init");
+    gfree = (free_func) dlsym(RTLD_DEFAULT, "g_free");
     my_get_default_func = (fp_client_get_default_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_default");
-    if (my_g_type_init_func != NULL && my_get_default_func != NULL) {
+    if (type_init != NULL && gfree != NULL && my_get_default_func != NULL) {
       /**
        * Try to connect to GConf.
        */
-      (*my_g_type_init_func)();
+      (*type_init)();
       (*gconf_client) = (*my_get_default_func)();
       if ((*gconf_client) != NULL) {
         my_get_string_func = (fp_client_get_string_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_string");
--- a/src/solaris/native/common/deps/gconf2/gconf_fp.h	Wed Jul 25 18:24:09 2012 +0100
+++ b/src/solaris/native/common/deps/gconf2/gconf_fp.h	Mon Aug 06 13:31:40 2012 +0100
@@ -26,6 +26,7 @@
 #ifndef GCONF_GCONF_FP_H
 #define GCONF_GCONF_FP_H
 
+#include <glib_fp.h>
 #include <gconf/gconf-client.h>
 #include <jni.h>
 #include <stddef.h>
@@ -35,7 +36,6 @@
 extern fp_client_get_int_func* my_get_int_func;
 extern fp_client_get_bool_func* my_get_bool_func;
 extern fp_conf_init_func* my_gconf_init_func;
-extern fp_type_init_func* my_g_type_init_func;
 
 #define gconf_client_get_default (*my_get_default_func)
 #define gconf_client_get_string (*my_get_string_func)
--- a/src/solaris/native/common/deps/glib2/gio/gio_typedefs.h	Wed Jul 25 18:24:09 2012 +0100
+++ b/src/solaris/native/common/deps/glib2/gio/gio_typedefs.h	Mon Aug 06 13:31:40 2012 +0100
@@ -45,7 +45,6 @@
   G_FILE_QUERY_INFO_NONE = 0
 } GFileQueryInfoFlags;
 
-typedef void (*type_init_func)(void);
 typedef void (*object_unref_func)(gpointer object);
 typedef GFile* (*file_new_for_path_func)(const char* path);
 typedef GFileInfo* (*file_query_info_func)(GFile *file,
@@ -62,6 +61,5 @@
 typedef gint (*settings_get_int_func) (GSettings *settings, const gchar *key);
 typedef GSettings* (*settings_get_child_func) (GSettings *settings, const gchar *name);
 typedef void (*strfreev_func) (gchar **str_array);
-typedef void (*free_func) (gpointer mem);
 
 #endif
--- a/src/solaris/native/common/deps/glib2/gio_fp.h	Wed Jul 25 18:24:09 2012 +0100
+++ b/src/solaris/native/common/deps/glib2/gio_fp.h	Mon Aug 06 13:31:40 2012 +0100
@@ -28,7 +28,8 @@
 
 #include <gio/gio_typedefs.h>
 
-extern type_init_func type_init;
+#include <glib_fp.h>
+
 extern object_unref_func object_unref;
 extern file_new_for_path_func file_new_for_path;
 extern file_query_info_func file_query_info;
@@ -41,10 +42,9 @@
 extern settings_get_int_func settings_get_int;
 extern settings_get_child_func settings_get_child;
 extern strfreev_func gstrfreev;
-extern free_func gfree;
 
-#define g_type_init (*type_init)
 #define g_object_unref (*object_unref)
+#define g_strfreev (*gstrfreev)
 #define g_file_new_for_path (*file_new_for_path)
 #define g_file_query_info (*file_query_info)
 #define g_file_info_get_content_type (*file_info_get_content_type)
@@ -55,8 +55,6 @@
 #define g_settings_get_strv (*settings_get_strv)
 #define g_settings_get_int (*settings_get_int)
 #define g_settings_get_child (*settings_get_child)
-#define g_strfreev (*gstrfreev)
-#define g_free (*gfree)
 
 jboolean gio_init();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/native/common/deps/glib2/glib_fp.h	Mon Aug 06 13:31:40 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 Red Hat Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef __GLIB_FP_H__
+#define __GLIB_FP_H__
+
+typedef void (*type_init_func)(void);
+typedef void (*free_func) (void* mem);
+
+extern type_init_func type_init;
+extern free_func gfree;
+
+#define g_type_init (*type_init)
+#define g_free (*gfree)
+
+#endif /* __GLIB_FP_H__ */