Module Name: src Committed By: christos Date: Thu Oct 31 21:02:11 UTC 2013
Modified Files: src/tests/lib/libobjc: t_threads.m Log Message: Handle new objc for gcc-4.8.1. Someone with more objc foo can do this better. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libobjc/t_threads.m Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libobjc/t_threads.m diff -u src/tests/lib/libobjc/t_threads.m:1.1 src/tests/lib/libobjc/t_threads.m:1.2 --- src/tests/lib/libobjc/t_threads.m:1.1 Sun Jul 18 08:41:51 2010 +++ src/tests/lib/libobjc/t_threads.m Thu Oct 31 17:02:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: t_threads.m,v 1.1 2010/07/18 12:41:51 jmmv Exp $ */ +/* $NetBSD: t_threads.m,v 1.2 2013/10/31 21:02:11 christos Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -35,8 +35,11 @@ #include <atf-c.h> #include <objc/objc.h> -#include <objc/objc-api.h> +#include <objc/thr.h> #include <objc/Object.h> +#if __GNUC_PREREQ__(4,8) +#include <objc/runtime.h> +#endif static int IsMultithreaded = 0; static objc_mutex_t Mutex; @@ -46,6 +49,12 @@ static objc_condition_t Condition; { } -(void)start; +#if __GNUC_PREREQ__(4,8) +-init; ++new; ++alloc; +-free; +#endif @end @implementation MyClass @@ -55,6 +64,27 @@ static objc_condition_t Condition; objc_condition_signal(Condition); } +#if __GNUC_PREREQ__(4,8) +-init +{ + return self; +} + ++new +{ + return [[self alloc] init]; +} + ++alloc +{ + return class_createInstance(self, 0); +} + +-free +{ + return object_dispose(self); +} +#endif @end static void