ObjFW  Diff

Differences From Artifact [34d39a737b]:

  • File src/runtime/lookup.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js size: 2501)

To Artifact [ef50fd350e]:

  • File src/runtime/lookup.m — part of check-in [345eb93240] at 2012-07-17 01:09:50 on branch trunk — Rename ERROR() to OBJC_ERROR(). ERROR seems to be defined on MinGW32 and it's likely that it's also used on other systems, thus it's better to prefix it with OBJC_. (user: js size: 2511)

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

		objc_initialize_class(cls);

		if (!(cls->info & OBJC_CLASS_INFO_SETUP)) {
			if (is_class)
				return objc_msg_lookup(nil, sel);
			else
				ERROR("Could not dispatch message for "
				    "incomplete class %s!", cls->name);
		}

		/*
		 * We don't need to handle the case that super was called.
		 * The reason for this is that a call to super is not possible
		 * before a message to the class has been sent and it thus has
		 * been initialized together with its superclasses.
		 */
		return objc_msg_lookup(obj, sel);
	}

	if (objc_forward_handler != NULL)
		return objc_forward_handler(obj, sel);

	ERROR("Selector %s is not implemented for class %s!",
	    sel_getName(sel), object_getClassName(obj));
}

BOOL
class_respondsToSelector(Class cls, SEL sel)
{
	if (cls == Nil)







|















|







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

		objc_initialize_class(cls);

		if (!(cls->info & OBJC_CLASS_INFO_SETUP)) {
			if (is_class)
				return objc_msg_lookup(nil, sel);
			else
				OBJC_ERROR("Could not dispatch message for "
				    "incomplete class %s!", cls->name);
		}

		/*
		 * We don't need to handle the case that super was called.
		 * The reason for this is that a call to super is not possible
		 * before a message to the class has been sent and it thus has
		 * been initialized together with its superclasses.
		 */
		return objc_msg_lookup(obj, sel);
	}

	if (objc_forward_handler != NULL)
		return objc_forward_handler(obj, sel);

	OBJC_ERROR("Selector %s is not implemented for class %s!",
	    sel_getName(sel), object_getClassName(obj));
}

BOOL
class_respondsToSelector(Class cls, SEL sel)
{
	if (cls == Nil)