From owner-svn-src-head@FreeBSD.ORG Sun Jun 16 10:48:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA1C458E; Sun, 16 Jun 2013 10:48:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0E3137D; Sun, 16 Jun 2013 10:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5GAmmGj082612; Sun, 16 Jun 2013 10:48:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5GAmmkG082610; Sun, 16 Jun 2013 10:48:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306161048.r5GAmmkG082610@svn.freebsd.org> From: Ed Schouten Date: Sun, 16 Jun 2013 10:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251804 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 10:48:48 -0000 Author: ed Date: Sun Jun 16 10:48:47 2013 New Revision: 251804 URL: http://svnweb.freebsd.org/changeset/base/251804 Log: Move _Atomic() into . That way _Atomic() is defined next to all the other C11 keywords for which we provide compatibility for pre-C11 compilers. While there, fix the definition to place "volatile" at the end. Otherwise pointer types will become "volatile T *" instead of "T * volatile". Modified: head/sys/sys/cdefs.h head/sys/sys/stdatomic.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jun 16 09:30:35 2013 (r251803) +++ head/sys/sys/cdefs.h Sun Jun 16 10:48:47 2013 (r251804) @@ -268,6 +268,14 @@ #define _Alignof(x) __alignof(x) #endif +#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) +/* + * No native support for _Atomic(). Place object in structure to prevent + * most forms of direct non-atomic access. + */ +#define _Atomic(T) struct { T volatile __val; } +#endif + #if defined(__cplusplus) && __cplusplus >= 201103L #define _Noreturn [[noreturn]] #else Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Sun Jun 16 09:30:35 2013 (r251803) +++ head/sys/sys/stdatomic.h Sun Jun 16 10:48:47 2013 (r251804) @@ -43,10 +43,6 @@ #error "stdatomic.h does not support your compiler" #endif -#if !defined(__CLANG_ATOMICS) -#define _Atomic(T) struct { volatile T __val; } -#endif - /* * 7.17.1 Atomic lock-free macros. */