ObjFW  Diff

Differences From Artifact [72b6e8f4e8]:

  • File src/OFPlugin.m — part of check-in [13ee56edf3] at 2014-06-21 21:43:43 on branch trunk — Move all macros from OFObject.h to macros.h

    This means that OFObject.h imports macros.h now, making it unnecessary
    to manually import macros.h in almost every file. And while at it, also
    import autorelease.h in OFObject.h, so that this doesn't need to be
    manually imported in almost every file as well. (user: js, size: 2059) [annotate] [blame] [check-ins using]

To Artifact [0a0de2607d]:


21
22
23
24
25
26
27

28
29
30
31
32
33
34

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

#import "OFPlugin.h"
#import "OFString.h"


#import "OFInitializationFailedException.h"

#ifdef _WIN32
# define dlsym(handle, symbol) GetProcAddress(handle, symbol)
# define dlclose(handle) FreeLibrary(handle)
#endif







>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

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

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

#import "OFInitializationFailedException.h"

#ifdef _WIN32
# define dlsym(handle, symbol) GetProcAddress(handle, symbol)
# define dlclose(handle) FreeLibrary(handle)
#endif
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
	init_plugin_t initPlugin;
	OFPlugin *plugin;

	path = [path stringByAppendingString: @PLUGIN_SUFFIX];

#ifndef _WIN32
	if ((handle = dlopen([path cStringWithEncoding:
	    [OFString nativeOSEncoding]], RTLD_LAZY)) == NULL)
#else
	if ((handle = LoadLibraryW([path UTF16String])) == NULL)
#endif
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	objc_autoreleasePoolPop(pool);







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	init_plugin_t initPlugin;
	OFPlugin *plugin;

	path = [path stringByAppendingString: @PLUGIN_SUFFIX];

#ifndef _WIN32
	if ((handle = dlopen([path cStringWithEncoding:
	    [OFSystemInfo native8BitEncoding]], RTLD_LAZY)) == NULL)
#else
	if ((handle = LoadLibraryW([path UTF16String])) == NULL)
#endif
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	objc_autoreleasePoolPop(pool);