That macro was being defined but not used anywhere, so it must be
safe to remove it.
Details
- Reviewers
- None
- Group Reviewers
Restricted Project - Commits
- rGe6126faba060: [libc++] Remove unused macro in __config
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is safe for libc++ use, so LGTM since CI is passing. As an aside, it looks like there are a few other spots in llvm that could benefit from the removal too:
git grep '__MAC_OS_X_VERSION_MIN_REQUIRED' clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:#if !(defined(_WIN32) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ clang-tools-extra/clangd/unittests/JSONTransportTests.cpp: __MAC_OS_X_VERSION_MIN_REQUIRED < 101300)) llvm/lib/Support/LockFileManager.cpp:#if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED > 1050)
__MAC_OS_X_VERSION_MIN_REQUIRED is defined by Apple's <Availability.h>. It is equivalent to __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, which is set by the compiler. I suspect libc++ was defining it at some point for internal use (e.g. in the code I removed in https://reviews.llvm.org/rGebaf1d5e2b87), but now it's not needed anymore.
This is safe for libc++ use, so LGTM since CI is passing. As an aside, it looks like there are a few other spots in llvm that could benefit from the removal too:
git grep '__MAC_OS_X_VERSION_MIN_REQUIRED' clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:#if !(defined(_WIN32) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ clang-tools-extra/clangd/unittests/JSONTransportTests.cpp: __MAC_OS_X_VERSION_MIN_REQUIRED < 101300)) llvm/lib/Support/LockFileManager.cpp:#if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED > 1050)
Good point -- those could either have been using the value defined in <Availability.h> or unknowingly using the one set by libc++. I'll move those over to __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, which is always defined by the compiler.