[PATCH] D25042: [libc++] Clarify _LIBCPP_NEW_DELETE_VIS for Windows

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 13:47:49 PDT 2016

smeenai updated this revision to Diff 72891.
smeenai added a comment.

Clarifying code comment



Index: include/new
--- include/new
+++ include/new
@@ -125,8 +125,18 @@
 }  // std
-#if defined(_WIN32) && !defined(cxx_EXPORTS)
+ * NOTE: When using the Microsoft CRT, the operator new and delete
+ * family of functions are defined statically in msvcrt.lib. Marking
+ * them as dllimport in this header is therefore undesirable: if we were
+ * to mark them dllimport and then link against libc++, source files
+ * which included <new> would end up linking against libc++'s new and
+ * delete, while source files which did not include <new> would end up
+ * still linking against msvcrt's new and delete, which would be a
+ * confusing and potentially error-prone inconsistency.
+ */
+#if defined(_LIBCPP_MSVCRT) && !defined(_LIBCPP_BUILDING_LIBRARY)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25042.72891.patch
Type: text/x-patch
Size: 980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160928/5335eaf6/attachment.bin>

More information about the cfe-commits mailing list