From: Mathieu Desnoyers Date: Mon, 20 Apr 2020 15:30:49 +0000 (-0400) Subject: Fix: tls-compat.h exposes compiler-dependent public configuration X-Git-Tag: v0.13.0~59 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=109267f653502cf5ef5ada5d098167b9726daa2d;hp=109267f653502cf5ef5ada5d098167b9726daa2d Fix: tls-compat.h exposes compiler-dependent public configuration Exposing the storage class chosen by ax_tls.m4 in a public header is a bad idea, because if a recent gcc is used when configuring liburcu, thus detecting C11, it will choose _Thread_local. Then, if an external project uses urcu/tls-compat.h with an older gcc (e.g. 4.8), it will fail to build, because that storage class is unknown, and __thread should be used instead. Therefore, use a preprocessor conditional on __cplusplus to detect C++11 (and use thread_local). Else, the STDC version is used to select _Thread_local. Else check if _MSC_VER is defined to select __declspec(thread), or else rely on __thread as fallback. Remove ax_tls.m4 because it is now unused. Signed-off-by: Mathieu Desnoyers ---