[libcxx-commits] [PATCH] D89863: [libcxxabi] Define _LIBCXXABI_WEAK properly for mingw compilers

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 21 03:45:37 PDT 2020


mstorsjo created this revision.
mstorsjo added reviewers: libc++, rnk.
Herald added a project: libc++abi.
Herald added a reviewer: libc++abi.
mstorsjo requested review of this revision.

This matches how _LIBCPP_WEAK is defined in libcxx; _LIBCPP_WEAK is empty if _LIBCPP_COMPILER_MSVC is defined.

(However _LIBCPP_COMPILER_MSVC is only defined if using MSVC, not clang in MSVC mode - so maybe this should be defined(_MSC_VER) && !defined(__CLANG__)?)

This allows users to override operator new/delete, if using those operators from libcxxabi instead of from libcxx.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89863

Files:
  libcxxabi/include/__cxxabi_config.h


Index: libcxxabi/include/__cxxabi_config.h
===================================================================
--- libcxxabi/include/__cxxabi_config.h
+++ libcxxabi/include/__cxxabi_config.h
@@ -53,7 +53,7 @@
  #endif
 #endif
 
-#if defined(_WIN32)
+#if defined(_MSC_VER)
 #define _LIBCXXABI_WEAK
 #else
 #define _LIBCXXABI_WEAK __attribute__((__weak__))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89863.299626.patch
Type: text/x-patch
Size: 355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201021/20e9b89a/attachment-0001.bin>


More information about the libcxx-commits mailing list