ObjFW  Check-in [6fa34f7811]

Overview
Comment:Fix -[conformsToProtocol:] for the old GNU runtime.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: 6fa34f7811095ea91489f789f379f6f0545f9d6d23a9976238b4145bbf15188b
User & Date: js on 2011-06-13 03:47:52
Other Links: branch diff | manifest | tags
Context
2011-06-13
21:28
Fix a typo in README. check-in: af13eba3c0 user: js tags: 0.5
03:47
Fix -[conformsToProtocol:] for the old GNU runtime. check-in: 6fa34f7811 user: js tags: 0.5
2011-06-06
16:19
Remove semicolons that should not have been there. check-in: 048ed62083 user: js tags: 0.5
Changes

Modified src/OFObject.m from [01ae05fc13] to [bd7981a871].

37
38
39
40
41
42
43

44
45
46
47
48
49
50
#import "macros.h"

#if defined(OF_OBJFW_RUNTIME)
# import <objfw-rt.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>
# import <objc/sarray.h>

#else
# import <objc/runtime.h>
#endif

#ifdef _WIN32
# include <windows.h>
#endif







>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import "macros.h"

#if defined(OF_OBJFW_RUNTIME)
# import <objfw-rt.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>
# import <objc/sarray.h>
# import <objc/Protocol.h>
#else
# import <objc/runtime.h>
#endif

#ifdef _WIN32
# include <windows.h>
#endif
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
	Class c;
	struct objc_protocol_list *pl;
	size_t i;

	for (c = self; c != Nil; c = class_get_super_class(c))
		for (pl = c->protocols; pl != NULL; pl = pl->next)
			for (i = 0; i < pl->count; i++)
				if ([pl->list[i] conformsToProtocol: protocol])
					return YES;

	return NO;
#else
	Class c;

	for (c = self; c != Nil; c = class_getSuperclass(c))







|







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
	Class c;
	struct objc_protocol_list *pl;
	size_t i;

	for (c = self; c != Nil; c = class_get_super_class(c))
		for (pl = c->protocols; pl != NULL; pl = pl->next)
			for (i = 0; i < pl->count; i++)
				if ([pl->list[i] conformsTo: protocol])
					return YES;

	return NO;
#else
	Class c;

	for (c = self; c != Nil; c = class_getSuperclass(c))