Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Aug 2013 08:18:50 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r254477 - stable/9/include
Message-ID:  <201308180818.r7I8Iolw041964@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Aug 18 08:18:49 2013
New Revision: 254477
URL: http://svnweb.freebsd.org/changeset/base/254477

Log:
  MFC r239960:
  
    Properly enable Clang-style atomics when available.
  
    In addition to testing against cxx_atomic, we must check c_atomic. The
    former is only set when building C++ code. Also use __has_extension
    instead of __has_feature. This allows us to use the atomics outside of
    C11.
  
  PR:	threads/170073

Modified:
  stable/9/include/stdatomic.h
Directory Properties:
  stable/9/include/   (props changed)

Modified: stable/9/include/stdatomic.h
==============================================================================
--- stable/9/include/stdatomic.h	Sun Aug 18 06:08:52 2013	(r254476)
+++ stable/9/include/stdatomic.h	Sun Aug 18 08:18:49 2013	(r254477)
@@ -33,7 +33,7 @@
 #include <sys/cdefs.h>
 #include <sys/_types.h>
 
-#if __has_feature(cxx_atomic)
+#if __has_extension(c_atomic) || __has_extension(cxx_atomic)
 #define	__CLANG_ATOMICS
 #elif __GNUC_PREREQ__(4, 7)
 #define	__GNUC_ATOMICS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308180818.r7I8Iolw041964>