ObjFW  Diff

Differences From Artifact [fd94d50205]:

  • File src/OFObject.m — part of check-in [cbdd534337] at 2009-04-12 14:51:00 on branch trunk — Get rid of the dependency on Object.

    This allows libobjfw to run on ObjC2-only runtimes like the one on the
    iPhone. However, it's still relying on objc_msgSendv for plugins, which
    is unavailable in ObjC2-only runtimes, thus OFPlugins are unavailable
    on the iPhone until I write a replacement for objc_msgSendv. (user: js, size: 9317) [annotate] [blame] [check-ins using]

To Artifact [4cc42158d1]:


113
114
115
116
117
118
119
120
121

122
123

124
125
126
127
128
129
130
131
132
133
134
	if (oldimp == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						    andSelector: _cmd];

	method->method_imp = newimp;
	return oldimp;
#else
	IMP imp = class_getMethodImplementation(class, selector);
	Method method = class_getInstanceMethod(self, selector);


	if (imp == NULL || method == NULL)

		@throw [OFInvalidArgumentException newWithClass: self
						    andSelector: _cmd];

	return method_setImplementation(method, imp);
#endif
}

- init
{
	return self;
}







<
|
>

|
>



|







113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
	if (oldimp == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						    andSelector: _cmd];

	method->method_imp = newimp;
	return oldimp;
#else

	Method m;
	IMP imp;

	if ((m = class_getInstanceMethod(self, selector)) == NULL ||
	    (imp = method_getImplementation(m)) == NULL)
		@throw [OFInvalidArgumentException newWithClass: self
						    andSelector: _cmd];

	return method_setImplementation(m, imp);
#endif
}

- init
{
	return self;
}
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
	/* Classes containing data should reimplement this! */
	return (self == obj ? YES : NO);
}

- (uint32_t)hash
{
	/* Classes containing data should reimplement this! */
	return (uint32_t)self;
}

- addToMemoryPool: (void*)ptr
{
	void **memchunks;
	size_t memchunks_size;








|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
	/* Classes containing data should reimplement this! */
	return (self == obj ? YES : NO);
}

- (uint32_t)hash
{
	/* Classes containing data should reimplement this! */
	return (uint32_t)(intptr_t)self;
}

- addToMemoryPool: (void*)ptr
{
	void **memchunks;
	size_t memchunks_size;