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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 30 04:34:22 PDT 2026


https://github.com/ldionne approved this pull request.

LGTM.

Part of me would rather use a libc++ macro instead of the native platform macro (for example `_LIBCPP_WINDOWS`, `_LIBCPP_APPLE`, `_LIBCPP_LINUX`, etc) since that makes me confident that we're setting it in the right cases without being familiar with the underlying platform.

For example, I don't know exactly when `_WIN32` is defined, but if I read `_LIBCPP_WINDOWS`, then I can be confident that this is properly representing whenever we're compiling for Windows, and that any `_WIN32 -> libc++ specific term` has already been handled somewhere.

However, I agree that consistency with current code is to use `_WIN32` since we use `__APPLE__`, `__FreeBSD__` and friends elsewhere, so I'm fine with making things consistent in this patch, and then changing wholesale if we ever get an appetite for it.

IOW, this is an improvement given the current status quo, but I question whether we like the status quo. Still not a reason not to move forward with this.

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


More information about the libcxx-commits mailing list