Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2006-10-17 21:16:48 +0000
committerGrant Gayed2006-10-17 21:16:48 +0000
commitd8d47f31030b0f019027b58a46920c7a4bdfdcae (patch)
treeebdb09c868784c38c91deb6346bd2a46a4f3d63b /bundles/org.eclipse.swt/Eclipse SWT PI/gtk
parent9d1439265256d4dc44e7ee7f2321b1596dcd5b6c (diff)
downloadeclipse.platform.swt-d8d47f31030b0f019027b58a46920c7a4bdfdcae.tar.gz
eclipse.platform.swt-d8d47f31030b0f019027b58a46920c7a4bdfdcae.tar.xz
eclipse.platform.swt-d8d47f31030b0f019027b58a46920c7a4bdfdcae.zip
154429
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c39
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java4
3 files changed, 41 insertions, 32 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 52cc821ed2..5328ccdfaf 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
@@ -6127,36 +6127,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1pack_1start)
}
#endif
-#ifndef NO__1gtk_1cell_1layout_1set_1attributes
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1set_1attributes)
- (JNIEnv *env, jclass that, jint arg0, jint arg1, jbyteArray arg2, jint arg3, jint arg4)
-{
- jbyte *lparg2=NULL;
- OS_NATIVE_ENTER(env, that, _1gtk_1cell_1layout_1set_1attributes_FUNC);
- if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
-/*
- gtk_cell_layout_set_attributes(arg0, arg1, lparg2, arg3, arg4);
-*/
- {
- static int initialized = 0;
- static void *handle = NULL;
- typedef void (*FPTR)(jint, jint, jbyte *, jint, jint);
- static FPTR fptr;
- if (!initialized) {
- if (!handle) handle = dlopen(gtk_cell_layout_set_attributes_LIB, RTLD_LAZY);
- if (handle) fptr = (FPTR)dlsym(handle, "gtk_cell_layout_set_attributes");
- initialized = 1;
- }
- if (fptr) {
- (*fptr)(arg0, arg1, lparg2, arg3, arg4);
- }
- }
-fail:
- if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
- OS_NATIVE_EXIT(env, that, _1gtk_1cell_1layout_1set_1attributes_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1cell_1renderer_1get_1size
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1renderer_1get_1size)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jintArray arg3, jintArray arg4, jintArray arg5, jintArray arg6)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
index 9b0ff027a3..041be589df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
@@ -76,3 +76,42 @@ fail:
return rc;
}
#endif
+
+#ifndef NO__1gtk_1cell_1layout_1set_1attributes
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1set_1attributes)
+ (JNIEnv *env, jclass that, SWT_PTR arg0, SWT_PTR arg1, jbyteArray arg2, jint arg3, SWT_PTR arg4)
+{
+ jbyte *lparg2=NULL;
+ OS_NATIVE_ENTER(env, that, _1gtk_1cell_1layout_1set_1attributes_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
+/*
+ gtk_cell_layout_set_attributes(arg0, arg1, lparg2, arg3, arg4);
+*/
+ {
+ static int initialized = 0;
+ static void *handle = NULL;
+ /*
+ * On AMD64, it is critical that functions which have a variable number of
+ * arguments, indicated by '...', include the '...' in their prototype. This
+ * changes the calling convention, and leaving it out will cause crashes.
+ *
+ * For some reason, we must also explicitly declare all of the arguments we
+ * are passing in, otherwise it crashes.
+ */
+/* typedef void (*FPTR)(SWT_PTR, SWT_PTR, ...); */
+ typedef void (*FPTR)(SWT_PTR, SWT_PTR, jbyte *, jint, SWT_PTR, ...);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!handle) handle = dlopen(gtk_cell_layout_set_attributes_LIB, RTLD_LAZY);
+ if (handle) fptr = (FPTR)dlsym(handle, "gtk_cell_layout_set_attributes");
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1, lparg2, arg3, arg4);
+ }
+ }
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, _1gtk_1cell_1layout_1set_1attributes_FUNC);
+}
+#endif
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 dc1b49d2eb..7563f49224 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
@@ -3834,8 +3834,8 @@ public static final void gtk_cell_layout_clear(int /*long*/ cell_layout) {
lock.unlock();
}
}
-public static final native void _gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int sentinel);
-public static final void gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int sentinel) {
+public static final native void _gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel);
+public static final void gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel) {
lock.lock();
try {
_gtk_cell_layout_set_attributes(cell_layout, cell, attribute, column, sentinel);

Back to the top