295 * applying this workaround on Solaris as well. 296 */ 297 static void* dl_symbol(const char* name) 298 { 299 void* result = dlsym(gtk2_libhandle, name); 300 if (!result) 301 longjmp(j, NO_SYMBOL_EXCEPTION); 302 303 return result; 304 } 305 306 static void* dl_symbol_gthread(const char* name) 307 { 308 void* result = dlsym(gthread_libhandle, name); 309 if (!result) 310 longjmp(j, NO_SYMBOL_EXCEPTION); 311 312 return result; 313 } 314 315 gboolean gtk2_check(const char* lib_name, int flags) 316 { 317 if (gtk2_libhandle != NULL) { 318 /* We've already successfully opened the GTK libs, so return true. */ 319 return TRUE; 320 } else { 321 void *lib = NULL; 322 323 lib = dlopen(lib_name, flags); 324 325 if (lib == NULL) { 326 return FALSE; 327 } 328 329 if (flags & RTLD_NOLOAD) { 330 return TRUE; 331 } 332 333 fp_gtk_check_version = dlsym(lib, "gtk_check_version"); 334 /* Check for GTK 2.2+ */ 335 if (!fp_gtk_check_version(2, 2, 0)) { 336 return TRUE; 337 } 338 339 // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065 340 // dlclose(lib); 341 342 return FALSE; 343 } 344 } 345 346 #define ADD_SUPPORTED_ACTION(actionStr) \ 347 do { \ 348 jfieldID fld_action = (*env)->GetStaticFieldID(env, cls_action, actionStr, "Ljava/awt/Desktop$Action;"); \ 349 if (!(*env)->ExceptionCheck(env)) { \ 350 jobject action = (*env)->GetStaticObjectField(env, cls_action, fld_action); \ | 295 * applying this workaround on Solaris as well. 296 */ 297 static void* dl_symbol(const char* name) 298 { 299 void* result = dlsym(gtk2_libhandle, name); 300 if (!result) 301 longjmp(j, NO_SYMBOL_EXCEPTION); 302 303 return result; 304 } 305 306 static void* dl_symbol_gthread(const char* name) 307 { 308 void* result = dlsym(gthread_libhandle, name); 309 if (!result) 310 longjmp(j, NO_SYMBOL_EXCEPTION); 311 312 return result; 313 } 314 315 gboolean gtk2_check(const char* lib_name) 316 { 317 if (gtk2_libhandle != NULL) { 318 /* We've already successfully opened the GTK libs, so return true. */ 319 return TRUE; 320 } else { 321 void *lib = NULL; 322 323 lib = dlopen(lib_name, RTLD_LAZY | RTLD_LOCAL); 324 325 if (lib == NULL) { 326 return FALSE; 327 } 328 329 fp_gtk_check_version = dlsym(lib, "gtk_check_version"); 330 /* Check for GTK 2.2+ */ 331 if (!fp_gtk_check_version(2, 2, 0)) { 332 return TRUE; 333 } 334 335 // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065 336 // dlclose(lib); 337 338 return FALSE; 339 } 340 } 341 342 #define ADD_SUPPORTED_ACTION(actionStr) \ 343 do { \ 344 jfieldID fld_action = (*env)->GetStaticFieldID(env, cls_action, actionStr, "Ljava/awt/Desktop$Action;"); \ 345 if (!(*env)->ExceptionCheck(env)) { \ 346 jobject action = (*env)->GetStaticObjectField(env, cls_action, fld_action); \ |