summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-04-29 11:33:56 +0000
committerManolo Gouy <Manolo>2015-04-29 11:33:56 +0000
commita94642ee3000de231a2e43ff41e1b99738de3646 (patch)
treef13dee482be2f569c3cb071ecc87e6e73460dfb7 /src
parentf9fa74e3af0b53102ade659a7a2aa12ddf9ee9a3 (diff)
Simpler writing of Fl_X::get_carbon_function().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10727 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 4cb7f9140..68f19b129 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4476,15 +4476,8 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
PMSessionPageSetupDialog and PMSessionPrintDialog used by 10.4 or before (in Fl_Printer::start_job())
*/
void *Fl_X::get_carbon_function(const char *function_name) {
- static void *carbon = NULL;
- void *f = NULL;
- if (!carbon) {
- carbon = dlopen("/System/Library/Frameworks/Carbon.framework/Carbon", RTLD_LAZY);
- }
- if (carbon) {
- f = dlsym(carbon, function_name);
- }
- return f;
+ static void *carbon = dlopen("/System/Library/Frameworks/Carbon.framework/Carbon", RTLD_LAZY);
+ return (carbon ? dlsym(carbon, function_name) : NULL);
}
/* Returns the version of the running Mac OS as an int such as 100802 for 10.8.2