如何在Mac OSX clang上获得对thread_local的支持? [英] How to get support for thread_local on Mac OSX clang?

查看:396
本文介绍了如何在Mac OSX clang上获得对thread_local的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此答案所示,Mac OSX上Xcode中的clang不支持 thread_local 存储,即使设置了C ++ 11标志。即使是最新版本的Apple LLVM版本7.0.0(clang-700.1.76),目标:x86_64-apple-darwin15.0.0,线程模型:posix,也不支持 thread_local

As shown in this answer, clang from Xcode on Mac OSX does not support thread_local storage even with C++11 flags set. Even on the latest version, Apple LLVM version 7.0.0 (clang-700.1.76), Target: x86_64-apple-darwin15.0.0, Thread model: posix, does not support thread_local:

../../src/dir/sysArch.h:1505:3: error: thread-local storage is not supported
                                       for the current target
  thread_local
  ^


推荐答案

Xcode 8(及更高版本)提供的clang版本支持 thread_local 关键字;请参见此处

The version of clang supplied with Xcode 8 (and later) supports the thread_local keyword; see the discussion here.

这篇关于如何在Mac OSX clang上获得对thread_local的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆