Overview
Comment: | Add support for the new GNU runtime.
Currently, the properties test for nonatomic fails. This is a bug in |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6f4eb004a3185dbf1fba6069be85d762 |
User & Date: | js on 2010-12-18 23:39:20 |
Other Links: | manifest | tags |
Context
2010-12-20
| ||
15:12 | Documentation improvements. check-in: bf836060fb user: js tags: trunk | |
2010-12-18
| ||
23:39 | Add support for the new GNU runtime. check-in: 6f4eb004a3 user: js tags: trunk | |
2010-12-16
| ||
18:22 | Allow -Wl,* in objfw-compile. check-in: 12e47e3771 user: js tags: trunk | |
Changes
Modified configure.ac from [206a8f73e3] to [6b24bd807a].
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | AC_PROG_OBJCPP AC_PROG_LN_S AC_PROG_INSTALL AC_PROG_EGREP CPP="$OBJCPP" CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS" |
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - - + - + - + + + + + + + + + + - + + | ]) AC_CHECK_HEADERS([objfw-rt.h objc/objc.h]) test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT" AS_IF([test x"$ac_cv_header_objc_objc_h" = x"yes"], [ |
︙ | |||
115 116 117 118 119 120 121 122 123 124 125 126 127 128 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | + + + + + | LIBS="$LIBS -lobjc" ;; GNU) AC_DEFINE(OF_GNU_RUNTIME, 1, [Whether we use the GNU ObjC runtime]) LIBS="$LIBS -lobjc" ;; "old GNU") AC_DEFINE(OF_OLD_GNU_RUNTIME, 1, [Whether we use the old GNU ObjC runtime]) LIBS="$LIBS -lobjc" ;; *) AC_MSG_RESULT(none) AC_MSG_ERROR(No ObjC runtime found! Please install ObjFW-RT!) ;; esac AC_MSG_RESULT($objc_runtime) |
︙ |
Modified src/OFBlock.m from [d6602a5fe7] to [49b08c57ae].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + + | #import "atomic.h" @protocol RetainRelease - retain; - (void)release; @end |
︙ |
Modified src/OFExceptions.m from [e89fd4d506] to [250b6ae1fd].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + - - + | #include "config.h" #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> |
︙ |
Modified src/OFObject.m from [5f364917f3] to [72f139fc0b].
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + - - + + - - + - + | #import "OFObject.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "macros.h" #if defined(OF_OBJFW_RUNTIME) # import <objfw-rt.h> |
︙ | |||
108 109 110 111 112 113 114 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + | if (!objc_properties_init()) { fputs("Runtime error: objc_properties_init() failed!\n", stderr); abort(); } #endif |
︙ | |||
182 183 184 185 186 187 188 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | - + - + | + (Class)superclass { return class_getSuperclass(self); } + (BOOL)instancesRespondToSelector: (SEL)selector { |
︙ | |||
218 219 220 221 222 223 224 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | - - + + - + - + - - + - - + - + + - + + | #endif } + (IMP)instanceMethodForSelector: (SEL)selector { #if defined(OF_OBJFW_RUNTIME) return objc_get_instance_method(self, selector); |
︙ | |||
271 272 273 274 275 276 277 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + - - - - - - - - - - | { #if defined(OF_OBJFW_RUNTIME) if (newimp == (IMP)0 || !class_respondsToSelector(self->isa, selector)) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; return objc_replace_class_method(self, selector, newimp); |
︙ | |||
304 305 306 307 308 309 310 311 312 313 314 315 316 317 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | + + + + + + + + + + + + + + | /* Update the dtable if necessary */ if (sarray_get_safe(((Class)self->class_pointer)->dtable, (sidx)method->method_name->sel_id)) sarray_at_put_safe(((Class)self->class_pointer)->dtable, (sidx)method->method_name->sel_id, method->method_imp); return oldimp; #else Method method; if (newimp == (IMP)0 || (method = class_getClassMethod(self, selector)) == NULL) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; /* * Cast needed because it's isa in the Apple runtime, but class_pointer * in the GNU runtime. */ return class_replaceMethod(((OFObject*)self)->isa, selector, newimp, method_getTypeEncoding(method)); #endif } + (IMP)replaceClassMethod: (SEL)selector withMethodFromClass: (Class)class; { IMP newimp; |
︙ | |||
331 332 333 334 335 336 337 | 334 335 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 | - + - - - - - - - - - - + + + + + + + + + + | { #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); |
︙ | |||
408 409 410 411 412 413 414 | 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 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | - + - - + + - + - + - - + - - + - + + - + + | return YES; return NO; } - (BOOL)respondsToSelector: (SEL)selector { |
︙ |
Modified src/objfw-defs.h.in from [24da91ee6d] to [5535a2e37e].
︙ | |||
12 13 14 15 16 17 18 19 20 21 | 12 13 14 15 16 17 18 19 20 21 22 | + | #undef OF_HAVE_POLL #undef OF_HAVE_PROPERTIES #undef OF_HAVE_PTHREADS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_SCHED_YIELD #undef OF_HAVE_SYS_SELECT_H #undef OF_OBJFW_RUNTIME #undef OF_OLD_GNU_RUNTIME #undef OF_PLUGINS #undef OF_THREADS #undef SIZE_MAX |
Modified tests/OFBlockTests.m from [3714ef1c3f] to [e76b67d1d2].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + - + | #import "OFString.h" #import "OFBlock.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #if defined(OF_OBJFW_RUNTIME) # include <objfw-rt.h> |
︙ |