[PATCH] D110781: [CUDA] Make sure <string.h> is included with original __THROW defined.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 6 10:06:44 PDT 2021


tra updated this revision to Diff 377587.
tra added a comment.

re-set __THROW to an empty value. It's still needed for CUDA-7.5


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110781

Files:
  clang/lib/Headers/__clang_cuda_runtime_wrapper.h


Index: clang/lib/Headers/__clang_cuda_runtime_wrapper.h
===================================================================
--- clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -208,7 +208,13 @@
 // CUDA-9.2 needs host-side memcpy for some host functions in
 // device_functions.hpp
 #if CUDA_VERSION >= 9020
+// string.h needs __THROW to match the rest of the system includes.
+#pragma pop_macro("__THROW")
 #include <string.h>
+// .. but we still need to undef it in order to include other CUDA headers.
+#pragma push_macro("__THROW")
+#undef __THROW
+#define __THROW
 #endif
 #include "crt/math_functions.hpp"
 #else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110781.377587.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211006/602f5367/attachment.bin>


More information about the cfe-commits mailing list