Overview
Comment: | Cleaner -[setImplementation:...] for old GNU runtime.
Still work needed to correctly update the dtable. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
fbee44d38e160b7680c486aa403848a5 |
User & Date: | js on 2011-07-31 19:45:37 |
Other Links: | manifest | tags |
Context
2011-07-31
| ||
20:03 | Correctly update the dtable for the old GNU runtime. check-in: df914ca51d user: js tags: trunk | |
19:45 | Cleaner -[setImplementation:...] for old GNU runtime. check-in: fbee44d38e user: js tags: trunk | |
02:07 | Implement adding methods for the GNU runtime. check-in: db5f8c2c1b user: js tags: trunk | |
Changes
Modified src/OFObject.h from [5c52be14f5] to [7e695cf1f5].
︙ | |||
374 375 376 377 378 379 380 381 382 383 384 385 386 387 | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | + + + + + + + + + + + + + + + + | * \param selector The selector of the instance method to replace * \param class_ The class from which the new instance method should be taken * \return The old implementation */ + (IMP)replaceInstanceMethod: (SEL)selector withMethodFromClass: (Class)class_; /** * \brief Adds a class method to the class. * * If the method already exists, nothing is done and NO is returned. If you want * to change the implementation of a method, use * setImplementation:forClassMethod:. * * \param selector The selector for the new method * \param typeEncoding The type encoding for the new method * \param implementation The implementation for the new method * \return Whether the method has been added */ + (BOOL)addClassMethod: (SEL)selector withTypeEncoding: (const char*)typeEncoding implementation: (IMP)implementation; /** * \brief Adds an instance method to the class. * * If the method already exists, nothing is done and NO is returned. If you want * to change the implementation of a method, use * setImplementation:forInstanceMethod:. * |
︙ |
Modified src/OFObject.m from [e350530160] to [c563fc5512].
︙ | |||
336 337 338 339 340 341 342 | 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - + - - - + + + + - - - + + + + + + + + - + - - - - - + + + + + + + + + + + - + | if (newImp == (IMP)0 || !class_respondsToSelector(self->isa, selector)) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; return objc_replace_class_method(self, selector, newImp); #elif defined(OF_OLD_GNU_RUNTIME) Method_t method; |
︙ | |||
399 400 401 402 403 404 405 | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | + + + - + - - + + - - - + + + + + + + + - + - - - - - + + - + + + + + + + + + | #if defined(OF_OBJFW_RUNTIME) if (newImp == (IMP)0 || !class_respondsToSelector(self, selector)) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; return objc_replace_instance_method(self, selector, newImp); #elif defined(OF_OLD_GNU_RUNTIME) Method_t method; MethodList_t iter; |
︙ |