Browse Source

use thread-local for C++11, check for standard compliance before
checking for compiler extensions

Julius Pfrommer 7 years ago
parent
commit
7b4fb8a1f7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/ua_util.h

+ 2 - 0
src/ua_util.h

@@ -25,6 +25,8 @@ extern "C" {
  * the encoding layer. */
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
 # define UA_THREAD_LOCAL _Thread_local /* C11 */
+#elif defined(__cplusplus) && __cplusplus > 199711L
+# define UA_THREAD_LOCAL thread_local /* C++11 */
 #elif defined(__GNUC__)
 # define UA_THREAD_LOCAL __thread /* GNU extension */
 #elif defined(_MSC_VER)