Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys hack for Objective-C __weak keyword



details:   https://anonhg.NetBSD.org/src/rev/779f6b1079c9
branches:  trunk
changeset: 808129:779f6b1079c9
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 06 20:25:29 2015 +0000

description:
hack for Objective-C __weak keyword

diffstat:

 sys/sys/cdefs_elf.h |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 6589b0e3d7fb -r 779f6b1079c9 sys/sys/cdefs_elf.h
--- a/sys/sys/cdefs_elf.h       Wed May 06 19:47:59 2015 +0000
+++ b/sys/sys/cdefs_elf.h       Wed May 06 20:25:29 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs_elf.h,v 1.47 2014/12/08 20:50:11 joerg Exp $     */
+/*     $NetBSD: cdefs_elf.h,v 1.48 2015/05/06 20:25:29 christos Exp $  */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -64,11 +64,14 @@
 #define        __weak_extern(sym)                                              \
     __asm(".weak " _C_LABEL_STRING(#sym));
 
+#ifndef __OBJC__
+/* Avoid overriding Apple's garbage collection keywords (__weak, __strong) */
 #if __GNUC_PREREQ__(4, 0)
 #define        __weak  __attribute__((__weak__))
 #else
 #define        __weak
 #endif
+#endif /* __OBJC__ */
 
 #if __GNUC_PREREQ__(4, 0)
 #define        __weak_reference(sym)   __attribute__((__weakref__(#sym)))



Home | Main Index | Thread Index | Old Index