[PATCH] D110325: [llvm] Remove conditional checking for macosx 10.5

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 08:24:21 PDT 2021


dexonsmith added inline comments.


================
Comment at: llvm/lib/Support/LockFileManager.cpp:38
 
-#if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED > 1050)
-#define USE_OSX_GETHOSTUUID 1
-#else
-#define USE_OSX_GETHOSTUUID 0
-#endif
-
-#if USE_OSX_GETHOSTUUID
+#if defined(__APPLE__)
 #include <uuid/uuid.h>
----------------
benlangmuir wrote:
> gethostuuid is not available on all Apple platforms, so we should still check for macOS specifically.  It looks like some other code is using this pattern to check the platform:
> 
> ```
> #if defined(__APPLE__)
> #include <TargetConditionals.h>
> #if TARGET_OS_OSX
> ...
> ```
Smaller change would be to drop the `__MAC_OS_X_VERSION_MIN_REQUIRED > 1050` check (avoids adding an extra include)... but in either case this doesn't buy us much, since we still need some sort of `USE_OSX_GETHOSTUUID` flag. If the goal is to remove use of libc++'s `__MAC_OS_X_VERSION_MIN_REQUIRED`, this could switch to the compiler-provided `__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__`...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110325/new/

https://reviews.llvm.org/D110325



More information about the llvm-commits mailing list