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

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 09:01:15 PDT 2021


ldionne abandoned this revision.
ldionne 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>
----------------
dexonsmith wrote:
> 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__`...
Yeah, that's what I did in D110289. I thought I could simplify it further but it looks like there isn't much that can be done, so I'll abandon this.


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