Differences From Artifact [6851361cb3]:
- File src/runtime/class.m — part of check-in [239fbb269e] at 2019-02-07 21:55:35 on branch trunk — More style improvements (user: js, size: 21062) [annotate] [blame] [check-ins using]
To Artifact [889cba075c]:
- File
src/runtime/class.m
— part of check-in
[ede088a30d]
at
2019-04-14 13:35:38
on branch trunk
— runtime: Match Apple's +[initialize] behavior
This now calls +[initialize] several times on the same class if it is
unimplemented in one or more of the classes in the chain, to match the
behavior of the Apple runtime. While the behavior before was safer, it
can lead to testing against the ObjFW runtime and everything working,
but then failing when trying to use it with the Apple runtime. (user: js, size: 21133) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
331 332 333 334 335 336 337 | /* * Set it first to prevent calling it recursively due to message sends * in the initialize method */ class->info |= OBJC_CLASS_INFO_INITIALIZED; class->isa->info |= OBJC_CLASS_INFO_INITIALIZED; | > > | | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | /* * Set it first to prevent calling it recursively due to message sends * in the initialize method */ class->info |= OBJC_CLASS_INFO_INITIALIZED; class->isa->info |= OBJC_CLASS_INFO_INITIALIZED; if (class_respondsToSelector(object_getClass(class), @selector(initialize))) [class initialize]; } void objc_initialize_class(Class class) { if (class->info & OBJC_CLASS_INFO_INITIALIZED) return; |
︙ | ︙ |