ObjFW  Diff

Differences From Artifact [cb86f84c31]:

To Artifact [2c713ca183]:


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
48




49
50
51
52
53
54

55

56
57
58
59
60
61
62
63
64
#include <string.h>

#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif

#import "OFPlugin.h"

#import "OFLocale.h"
#import "OFString.h"
#import "OFSystemInfo.h"

#import "OFInitializationFailedException.h"
#import "OFLoadPluginFailedException.h"

#ifndef RTLD_LAZY
# define RTLD_LAZY 0
#endif

@implementation OFPlugin
+ (instancetype)pluginWithPath: (OFString *)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (OFString *)pathForName: (OFString *)name
{




#if defined(OF_MACOS)
	return [name stringByAppendingFormat: @".bundle/Contents/MacOS/%@",
					      name.lastPathComponent];
#elif defined(OF_IOS)
	return [name stringByAppendingFormat: @".bundle/%@",
					      name.lastPathComponent];

#else

	return [name stringByAppendingString: @PLUGIN_SUFFIX];
#endif
}

- (instancetype)initWithPath: (OFString *)path
{
	self = [super init];

	@try {







>



















>
>
>
>
|
|
|
|
|
|
>
|
>

<







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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
#include <string.h>

#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif

#import "OFPlugin.h"
#import "OFFileManager.h"
#import "OFLocale.h"
#import "OFString.h"
#import "OFSystemInfo.h"

#import "OFInitializationFailedException.h"
#import "OFLoadPluginFailedException.h"

#ifndef RTLD_LAZY
# define RTLD_LAZY 0
#endif

@implementation OFPlugin
+ (instancetype)pluginWithPath: (OFString *)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (OFString *)pathForName: (OFString *)name
{
#if (defined(OF_MACOS) || defined(OF_IOS)) && defined(OF_HAVE_FILES)
	OFString *path = [name stringByAppendingPathExtension: @"bundle"];

	if ([[OFFileManager defaultManager] directoryExistsAtPath: path])
# if defined(OF_MACOS)
		return [path stringByAppendingFormat: @"/Contents/MacOS/%@",
						      name.lastPathComponent];
# elif defined(OF_IOS)
		return [name stringByAppendingFormat: @"/%@",
						      name.lastPathComponent];
# endif
#endif

	return [name stringByAppendingString: @PLUGIN_SUFFIX];

}

- (instancetype)initWithPath: (OFString *)path
{
	self = [super init];

	@try {