Differences From Artifact [fc21e7fba3]:
- File
src/OFPlugin.m
— part of check-in
[4642bc76b0]
at
2018-02-09 00:00:22
on branch trunk
— Add OFLoadPluginFailedException
OFOpenItemFailedException was too unspecific and only allowed an errno,
but dlopen() uses dlerror() to report errors, which returns a string. (user: js, size: 2946) [annotate] [blame] [check-ins using]
To Artifact [68f1ae3e39]:
- File src/OFPlugin.m — part of check-in [aa0384d1bf] at 2018-07-28 18:45:36 on branch trunk — Rename OFLocalization -> OFLocale (user: js, size: 2923) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 | #ifdef HAVE_DLFCN_H # include <dlfcn.h> #endif #import "OFPlugin.h" #import "OFString.h" | | | < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #ifdef HAVE_DLFCN_H # include <dlfcn.h> #endif #import "OFPlugin.h" #import "OFString.h" #import "OFLocale.h" #import "OFInitializationFailedException.h" #import "OFLoadPluginFailedException.h" typedef OFPlugin *(*init_plugin_t)(void); of_plugin_handle_t of_dlopen(OFString *path, int flags) { #ifndef OF_WINDOWS return dlopen([path cStringWithEncoding: [OFLocale encoding]], flags); #else if (path == nil) return GetModuleHandle(NULL); return LoadLibraryW([path UTF16String]); #endif } |
︙ | ︙ | |||
68 69 70 71 72 73 74 | } OFString * of_dlerror(void) { #ifndef OF_WINDOWS return [OFString stringWithCString: dlerror() | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | } OFString * of_dlerror(void) { #ifndef OF_WINDOWS return [OFString stringWithCString: dlerror() encoding: [OFLocale encoding]]; #else return nil; #endif } @implementation OFPlugin + (id)pluginFromFile: (OFString *)path |
︙ | ︙ |