[PATCH] D112081: Define __STDC_NO_THREADS__ when targeting windows-msvc (PR48704)

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 16 07:30:32 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbbc690c57213: Define __STDC_NO_THREADS__ when targeting windows-msvc (PR48704) (authored by hans).

Changed prior to commit:
  https://reviews.llvm.org/D112081?vs=380704&id=394877#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112081/new/

https://reviews.llvm.org/D112081

Files:
  clang/lib/Basic/Targets/OSTargets.cpp
  clang/test/Preprocessor/init.c


Index: clang/test/Preprocessor/init.c
===================================================================
--- clang/test/Preprocessor/init.c
+++ clang/test/Preprocessor/init.c
@@ -195,6 +195,7 @@
 // MSEXT-NOT:#define _NATIVE_WCHAR_T_DEFINED 1
 // MSEXT-NOT:#define _WCHAR_T_DEFINED 1
 // MSEXT:#define _MSVC_EXECUTION_CHARACTER_SET 65001
+// MSEXT:#define __STDC_NO_THREADS__ 1
 //
 //
 // RUN: %clang_cc1 -x c++ -fms-extensions -triple i686-pc-win32 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix MSEXT-CXX %s
Index: clang/lib/Basic/Targets/OSTargets.cpp
===================================================================
--- clang/lib/Basic/Targets/OSTargets.cpp
+++ clang/lib/Basic/Targets/OSTargets.cpp
@@ -203,6 +203,7 @@
   }
 
   Builder.defineMacro("_INTEGRAL_MAX_BITS", "64");
+  Builder.defineMacro("__STDC_NO_THREADS__");
 
   // Starting with VS 2022 17.1, MSVC predefines the below macro to inform
   // users of the execution character set defined at compile time.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112081.394877.patch
Type: text/x-patch
Size: 997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211216/6cfc1b57/attachment.bin>


More information about the cfe-commits mailing list