aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Wagiaalla2014-03-25 14:05:59 (EDT)
committerAlexander Kurtakov2014-07-08 09:24:15 (EDT)
commit85ba6031ace5949a21905dda2cc401e5ded56ad2 (patch)
treea0cd2fb79a7c73e1e38c00682ff537669d066cb1
parentd20acf6bc5bf02e3ebe32d6b46b87685581f358f (diff)
downloadeclipse.platform.swt-85ba6031ace5949a21905dda2cc401e5ded56ad2.zip
eclipse.platform.swt-85ba6031ace5949a21905dda2cc401e5ded56ad2.tar.gz
eclipse.platform.swt-85ba6031ace5949a21905dda2cc401e5ded56ad2.tar.bz2
Bug 431240 - Check for and print dlerror messagesrefs/changes/27/23927/2
Change-Id: I9df30a3e3f69530db4fb1c96cc71eab914e6d751 Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h14
2 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
index 759a458..f54feb4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
@@ -43,6 +43,7 @@
if (handle) { \
var = dlsym(handle, #name); \
} \
+ CHECK_DLERROR \
initialized = 1; \
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h b/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
index 67b75b6..861eea3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
@@ -28,6 +28,19 @@ extern "C" {
extern int IS_JNI_1_2;
+/* #define DEBUG */
+
+/* if DEBUG is defined print messages from dlerror */
+#ifdef DEBUG
+#define CHECK_DLERROR \
+ char* error = dlerror(); \
+ if (error != NULL) { \
+ fprintf(stderr, "dlerror: %s\n", error); \
+ }
+#else
+#define CHECK_DLERROR
+#endif
+
#ifndef JNI64
#if __x86_64__
#define JNI64
@@ -131,6 +144,7 @@ extern int IS_JNI_1_2;
void* handle = dlopen(name##_LIB, LOAD_FLAGS); \
if (handle) var = dlsym(handle, #name); \
initialized = 1; \
+ CHECK_DLERROR \
}
#endif