[libcxx-commits] [libcxx] [libc++] Clean up windows macros (PR #207577)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 10 06:37:03 PDT 2026


================
@@ -43,14 +43,11 @@
 #  endif
 
 #  if defined(_WIN32)
-#    define _LIBCPP_WIN32API
 #    define _LIBCPP_SHORT_WCHAR 1
-// Both MinGW and native MSVC provide a "MSVC"-like environment
-#    define _LIBCPP_MSVCRT_LIKE
-// If mingw not explicitly detected, assume using MS C runtime only if
-// a MS compatibility version is specified.
-#    if defined(_MSC_VER) && !defined(__MINGW32__)
-#      define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
+#    if defined(__MINGW32__)
+#      define _LIBCPP_LIBC_MINGW
----------------
ldionne wrote:

We usually define libc macros at configuration time right now: https://github.com/llvm/llvm-project/blob/9a1fe8e03c0499990b820d0151eabe60da864c9a/libcxx/CMakeLists.txt#L821

I suspect it would make sense to push those to configuration time as well: we should avoid introducing inconsistencies here.

If we don't want to block this patch on making these configure-time, I would change the name not to be `_LIBCPP_LIBC_something`. And if `_LIBCPP_LIBC_MINGW` isn't used, let's not add it.

https://github.com/llvm/llvm-project/pull/207577


More information about the libcxx-commits mailing list