ObjFW  Diff

Differences From Artifact [34b558d1e8]:

To Artifact [f6fefc29fd]:


120
121
122
123
124
125
126






























127
128
129
130
131
132
133

const char*
_NSPrintForDebugger(id object)
{
	return [[object description]
	    cStringWithEncoding: OF_STRING_ENCODING_NATIVE];
}































/* References for static linking */
void _references_to_categories_of_OFObject(void)
{
	_OFObject_Serialization_reference = 1;
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

const char*
_NSPrintForDebugger(id object)
{
	return [[object description]
	    cStringWithEncoding: OF_STRING_ENCODING_NATIVE];
}

#ifdef OF_OLD_GNU_RUNTIME
static BOOL
protocol_conformsToProtocol(Protocol *a, Protocol *b)
{
	/*
	 * This function is an ugly workaround for a bug that only happens with
	 * Clang 2.9 together with the libobjc from GCC 4.6.
	 * Since the instance variables of Protocol are @private, we have to
	 * cast them to a struct here in order to access them.
	 */
	struct objc_protocol {
		Class isa;
		const char *protocol_name;
		struct objc_protocol_list *protocol_list;
	} *pa = (struct objc_protocol*)a, *pb = (struct objc_protocol*)b;
	struct objc_protocol_list *pl;
	size_t i;

	if (!strcmp(pa->protocol_name, pb->protocol_name))
		return YES;

	for (pl = pa->protocol_list; pl != NULL; pl = pl->next)
		for (i = 0; i < pl->count; i++)
			if (protocol_conformsToProtocol(pl->list[i], b))
				return YES;

	return NO;
}
#endif

/* References for static linking */
void _references_to_categories_of_OFObject(void)
{
	_OFObject_Serialization_reference = 1;
}

270
271
272
273
274
275
276

277
278
279
280
281
282
283
284
	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))







>
|







300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
	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 (protocol_conformsToProtocol(pl->list[i],
				    protocol))
					return YES;

	return NO;
#else
	Class c;

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