Differences From Artifact [5d759baef8]:
- File src/OFPlugin.m — part of check-in [45f72a3f13] at 2018-02-07 21:11:16 on branch trunk — OFPlugin: Adjust to having proper .bundles now (user: js, size: 2789) [annotate] [blame] [check-ins using]
To 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]
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + | #endif #import "OFPlugin.h" #import "OFString.h" #import "OFLocalization.h" #import "OFInitializationFailedException.h" |
︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | + + + + + + + + + + + + - + - - + | { #ifndef OF_WINDOWS dlclose(handle); #else FreeLibrary(handle); #endif } OFString * of_dlerror(void) { #ifndef OF_WINDOWS return [OFString stringWithCString: dlerror() encoding: [OFLocalization encoding]]; #else return nil; #endif } @implementation OFPlugin + (id)pluginFromFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); of_plugin_handle_t handle; init_plugin_t initPlugin; OFPlugin *plugin; #if defined(OF_MACOS) path = [path stringByAppendingFormat: @".bundle/Contents/MacOS/%@", [path lastPathComponent]]; #elif defined(OF_IOS) path = [path stringByAppendingFormat: @".bundle/%@", [path lastPathComponent]]; #else path = [path stringByAppendingString: @PLUGIN_SUFFIX]; #endif if ((handle = of_dlopen(path, OF_RTLD_LAZY)) == NULL) @throw [OFLoadPluginFailedException |
︙ |