Skip to content

Commit b9a2097

Browse files
authored
[libc] Remove unused target conditionals for Apple platforms (#119030)
It seems that LIBC_TARGET_OS_IS_MACOS and LIBC_TARGET_OS_IS_IPHONE were never actually used in the code, so these definitions can be removed. I came across these because libc++ now depends on llvm-libc to build (for from_chars), and the unguarded use of TargetConditionals.h broke some of our downstream configurations. There are some platforms for which `__APPLE__` is defined but that don't provide TargetConditionals.h. If there is a need to keep defining those, the compiler also provides some uglier macro definitions like __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ that do not require including any header.
1 parent 788d5a5 commit b9a2097

File tree

1 file changed

+0
-12
lines changed
  • libc/src/__support/macros/properties

1 file changed

+0
-12
lines changed

libc/src/__support/macros/properties/os.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@
2525
#define LIBC_TARGET_OS_IS_WINDOWS
2626
#endif
2727

28-
#if (defined(__apple__) || defined(__APPLE__) || defined(__MACH__))
29-
// From https://stackoverflow.com/a/49560690
30-
#include "TargetConditionals.h"
31-
#if defined(TARGET_OS_OSX)
32-
#define LIBC_TARGET_OS_IS_MACOS
33-
#endif
34-
#if defined(TARGET_OS_IPHONE)
35-
// This is set for any non-Mac Apple products (IOS, TV, WATCH)
36-
#define LIBC_TARGET_OS_IS_IPHONE
37-
#endif
38-
#endif
39-
4028
#if defined(__Fuchsia__)
4129
#define LIBC_TARGET_OS_IS_FUCHSIA
4230
#endif

0 commit comments

Comments
 (0)