def ask_supports_thread():
from distutils.core import Distribution
from distutils.sysconfig import get_config_vars
get_config_vars() # workaround for a bug of distutils, e.g. on OS/X
config = Distribution().get_command_obj('config')
ok = config.try_compile('__thread int some_threadlocal_variable_42;')
if ok:
define_macros.append(('USE__THREAD', None))
else:
ok1 = config.try_compile('int some_regular_variable_42;')
if not ok1:
no_working_compiler_found()
sys.stderr.write("Note: will not use '__thread' in the C code\n")
sys.stderr.write("The above error message can be safely ignored\n")
评论列表
文章目录