aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-02-07 10:43:57 (EST)
committerCarolyn MacLeod2013-04-09 10:49:42 (EDT)
commit7a8d7d32f0a6014c170029f18f1c02c5c20fd5e4 (patch)
tree8173ddf91fd6d0a81a0464738cd067deb695a9db
parentb8ce6984ca175f11e65ded887ef60141930cd419 (diff)
downloadeclipse.platform.swt-7a8d7d32f0a6014c170029f18f1c02c5c20fd5e4.zip
eclipse.platform.swt-7a8d7d32f0a6014c170029f18f1c02c5c20fd5e4.tar.gz
eclipse.platform.swt-7a8d7d32f0a6014c170029f18f1c02c5c20fd5e4.tar.bz2
Do not use g_thread_init on Glib newer than 2.32.
It is already called internally by glib so no need to call it explicitly. This also allows us to keep compiling with G_DISABLE_DEPRECATED.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java8
4 files changed, 33 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 78e127d..de01c3e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -4145,7 +4145,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1g_1thread_1init)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1g_1thread_1init_FUNC);
+/*
g_thread_init((GThreadFunctions *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_thread_init)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GThreadFunctions *))fp)((GThreadFunctions *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1g_1thread_1init_FUNC);
}
#endif
@@ -4156,7 +4164,15 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(_1g_1thread_1supported)
{
jboolean rc = 0;
OS_NATIVE_ENTER(env, that, _1g_1thread_1supported_FUNC);
+/*
rc = (jboolean)g_thread_supported();
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_thread_supported)
+ if (fp) {
+ rc = (jboolean)((jboolean (CALLING_CONVENTION*)())fp)();
+ }
+ }
OS_NATIVE_EXIT(env, that, _1g_1thread_1supported_FUNC);
return rc;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index e20523f..f655ac4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -3301,7 +3301,10 @@ public static final long /*int*/ g_type_register_static (long /*int*/ parent_typ
lock.unlock();
}
}
-/** @param vtable cast=(GThreadFunctions *) */
+/**
+ * @method flags=dynamic
+ * @param vtable cast=(GThreadFunctions *)
+ */
public static final native void _g_thread_init(long /*int*/ vtable);
public static final void g_thread_init(long /*int*/ vtable) {
lock.lock();
@@ -3311,6 +3314,9 @@ public static final void g_thread_init(long /*int*/ vtable) {
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ */
public static final native boolean _g_thread_supported();
public static final boolean g_thread_supported() {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index f775588..651d150 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -69,8 +69,10 @@ public final class Printer extends Device {
static boolean disablePrinting = System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$
static void gtk_init() {
- if (!OS.g_thread_supported ()) {
- OS.g_thread_init (0);
+ if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) {
+ if (!OS.g_thread_supported()) {
+ OS.g_thread_init(0);
+ }
}
if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
OS.gtk_set_locale();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index c444057..67f1015 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -912,9 +912,11 @@ protected void create (DeviceData data) {
}
void createDisplay (DeviceData data) {
- /* Required for g_main_context_wakeup */
- if (!OS.g_thread_supported ()) {
- OS.g_thread_init (0);
+ if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) {
+ /* Required for g_main_context_wakeup */
+ if (!OS.g_thread_supported()) {
+ OS.g_thread_init(0);
+ }
}
if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
OS.gtk_set_locale();