Skip to content

Commit 773b303

Browse files
committed
TARGET_OS_OSX || TARGET_OS_IPHONE -> TARGET_OS_MAC
1 parent 6787a71 commit 773b303

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+282
-282
lines changed

CoreFoundation/Base.subproj/CFBase.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#if _POSIX_THREADS
1818
#include <pthread.h>
1919
#endif
20-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
20+
#if TARGET_OS_MAC
2121
#include <malloc/malloc.h>
2222
#include <mach/mach.h>
2323
#include <dlfcn.h>
@@ -29,7 +29,7 @@
2929

3030
struct __CFAllocator {
3131
CFRuntimeBase _base;
32-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
32+
#if TARGET_OS_MAC
3333
// CFAllocator structure must match struct _malloc_zone_t!
3434
// The first two reserved fields in struct _malloc_zone_t are for us with CFRuntimeBase
3535
size_t (*size)(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */
@@ -465,7 +465,7 @@ void CFAllocatorSetDefault(CFAllocatorRef allocator) {
465465
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
466466
}
467467
#endif
468-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
468+
#if TARGET_OS_MAC
469469
if (allocator && allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
470470
return; // require allocator to this function to be an allocator
471471
}
@@ -491,7 +491,7 @@ static CFAllocatorRef __CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorC
491491
CFAllocatorRetainCallBack retainFunc;
492492
CFAllocatorAllocateCallBack allocateFunc;
493493
void *retainedInfo;
494-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
494+
#if TARGET_OS_MAC
495495
if (allocator && kCFAllocatorUseContext != allocator && allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
496496
return NULL; // require allocator to this function to be an allocator
497497
}
@@ -525,7 +525,7 @@ static CFAllocatorRef __CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorC
525525
memset(memory, 0, sizeof(CFRuntimeBase));
526526
__CFRuntimeSetRC(memory, 1);
527527
_CFAllocatorSetInstanceTypeIDAndIsa(memory);
528-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
528+
#if TARGET_OS_MAC
529529
memory->size = __CFAllocatorCustomSize;
530530
memory->malloc = __CFAllocatorCustomMalloc;
531531
memory->calloc = __CFAllocatorCustomCalloc;
@@ -574,7 +574,7 @@ void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags
574574
allocator = __CFGetDefaultAllocator();
575575
}
576576

577-
#if defined(DEBUG) && (TARGET_OS_OSX || TARGET_OS_IPHONE)
577+
#if defined(DEBUG) && TARGET_OS_MAC
578578
if (allocator->_base._cfisa == __CFISAForCFAllocator()) {
579579
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
580580
}
@@ -605,15 +605,15 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
605605
allocator = __CFGetDefaultAllocator();
606606
}
607607

608-
#if defined(DEBUG) && (TARGET_OS_OSX || TARGET_OS_IPHONE)
608+
#if defined(DEBUG) && TARGET_OS_MAC
609609
if (allocator->_base._cfisa == __CFISAForCFAllocator()) {
610610
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
611611
}
612612
#else
613613
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
614614
#endif
615615
if (NULL == ptr && 0 < newsize) {
616-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
616+
#if TARGET_OS_MAC
617617
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
618618
return malloc_zone_malloc((malloc_zone_t *)allocator, newsize);
619619
}
@@ -626,7 +626,7 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
626626
return newptr;
627627
}
628628
if (NULL != ptr && 0 == newsize) {
629-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
629+
#if TARGET_OS_MAC
630630
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
631631
#if defined(DEBUG)
632632
size_t size = malloc_size(ptr);
@@ -643,7 +643,7 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
643643
return NULL;
644644
}
645645
if (NULL == ptr && 0 == newsize) return NULL;
646-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
646+
#if TARGET_OS_MAC
647647
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
648648
return malloc_zone_realloc((malloc_zone_t *)allocator, ptr, newsize);
649649
}
@@ -661,14 +661,14 @@ void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr) {
661661
allocator = __CFGetDefaultAllocator();
662662
}
663663

664-
#if defined(DEBUG) && (TARGET_OS_OSX || TARGET_OS_IPHONE)
664+
#if defined(DEBUG) && TARGET_OS_MAC
665665
if (allocator->_base._cfisa == __CFISAForCFAllocator()) {
666666
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
667667
}
668668
#else
669669
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
670670
#endif
671-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
671+
#if TARGET_OS_MAC
672672
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
673673
#if defined(DEBUG)
674674
size_t size = malloc_size(ptr);
@@ -691,14 +691,14 @@ CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex siz
691691
allocator = __CFGetDefaultAllocator();
692692
}
693693

694-
#if defined(DEBUG) && (TARGET_OS_OSX || TARGET_OS_IPHONE)
694+
#if defined(DEBUG) && TARGET_OS_MAC
695695
if (allocator->_base._cfisa == __CFISAForCFAllocator()) {
696696
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
697697
}
698698
#else
699699
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
700700
#endif
701-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
701+
#if TARGET_OS_MAC
702702
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
703703
return malloc_good_size(size);
704704
}
@@ -716,15 +716,15 @@ void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context
716716
allocator = __CFGetDefaultAllocator();
717717
}
718718

719-
#if defined(DEBUG) && (TARGET_OS_OSX || TARGET_OS_IPHONE)
719+
#if defined(DEBUG) && TARGET_OS_MAC
720720
if (allocator->_base._cfisa == __CFISAForCFAllocator()) {
721721
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
722722
}
723723
#else
724724
__CFGenericValidateType(allocator, _kCFRuntimeIDCFAllocator);
725725
#endif
726726
CFAssert1(0 == context->version, __kCFLogAssertion, "%s(): context version not initialized to 0", __PRETTY_FUNCTION__);
727-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
727+
#if TARGET_OS_MAC
728728
if (allocator->_base._cfisa != __CFISAForCFAllocator()) { // malloc_zone_t *
729729
return;
730730
}

CoreFoundation/Base.subproj/CFFileUtilities.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc,
342342
FindClose(handle);
343343
pathBuf[pathLength] = '\0';
344344

345-
#elif TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
345+
#elif TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
346346
uint8_t extBuff[CFMaxPathSize];
347347
int extBuffInteriorDotCount = 0; //people insist on using extensions like ".trace.plist", so we need to know how many dots back to look :(
348348

@@ -1141,7 +1141,7 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
11411141
if (dent->d_type == DT_DIR) {
11421142
isDirectory = true;
11431143
}
1144-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
1144+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
11451145
else if (dent->d_type == DT_UNKNOWN) {
11461146
// We need to do an additional stat on this to see if it's really a directory or not.
11471147
// This path should be uncommon.

CoreFoundation/Base.subproj/CFInternal.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ CF_EXPORT CFArrayRef _CFGetWindowsBinaryDirectories(void);
166166

167167
CF_EXPORT CFStringRef _CFStringCreateHostName(void);
168168

169-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
169+
#if TARGET_OS_MAC
170170
#include <CoreFoundation/CFRunLoop.h>
171171
CF_EXPORT void _CFMachPortInstallNotifyPort(CFRunLoopRef rl, CFStringRef mode);
172172
#endif
@@ -678,7 +678,7 @@ CF_PRIVATE void _CF_dispatch_once(dispatch_once_t *, void (^)(void));
678678

679679
#endif
680680

681-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
681+
#if TARGET_OS_MAC
682682
CF_PRIVATE _Atomic(uint8_t) __CF120293;
683683
CF_PRIVATE _Atomic(uint8_t) __CF120290;
684684
extern void __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__(void);
@@ -856,7 +856,7 @@ CF_INLINE uintptr_t __CFISAForTypeID(CFTypeID typeID) {
856856
// DEFINE_WEAK_CARBONCORE_FUNC(void, DisposeHandle, (Handle h), (h))
857857
//
858858

859-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
859+
#if TARGET_OS_MAC
860860

861861
extern void *__CFLookupCFNetworkFunction(const char *name);
862862

@@ -881,7 +881,7 @@ extern void *__CFLookupCFNetworkFunction(const char *name);
881881

882882
#define DEFINE_WEAK_CARBONCORE_FUNC(R, N, P, A, ...)
883883

884-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
884+
#if TARGET_OS_MAC
885885

886886
extern void *__CFLookupCoreServicesInternalFunction(const char *name);
887887

@@ -1083,7 +1083,7 @@ CF_PRIVATE uint8_t *_CFDataGetBytePtrNonObjC(CFDataRef data);
10831083
#pragma mark -
10841084
#pragma mark CF Instruments SPI
10851085

1086-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
1086+
#if TARGET_OS_MAC
10871087
extern void __CFRecordAllocationEvent(int eventnum, void *ptr, int64_t size, uint64_t data, const char *classname);
10881088
#else
10891089
#define __CFRecordAllocationEvent(a, b, c, d, e) ((void)0)

CoreFoundation/Base.subproj/CFKnownLocations.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUser user, CFStringRef _Nullable username) {
1919
CFURLRef location = NULL;
2020

21-
#if (TARGET_OS_OSX || TARGET_OS_IPHONE)
21+
#if TARGET_OS_MAC
2222

2323
/*
2424
Building for a Darwin OS. (We use these paths on Swift builds as well, so that we can interoperate a little with Darwin's defaults(1) command and the other system facilities; but you want to use the system version of CF if possible on those platforms, which will talk to cfprefsd(8) and has stronger interprocess consistency guarantees.)

CoreFoundation/Base.subproj/CFPlatform.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "CFInternal.h"
1313
#include <CoreFoundation/CFPriv.h>
14-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
14+
#if TARGET_OS_MAC
1515
#include <stdlib.h>
1616
#include <sys/stat.h>
1717
#include <string.h>
@@ -35,15 +35,15 @@
3535

3636
#endif
3737

38-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || DEPLOYMENT_TARGET_WINDOWS
38+
#if TARGET_OS_MAC || DEPLOYMENT_TARGET_WINDOWS
3939
#define kCFPlatformInterfaceStringEncoding kCFStringEncodingUTF8
4040
#else
4141
#define kCFPlatformInterfaceStringEncoding CFStringGetSystemEncoding()
4242
#endif
4343

4444
extern void __CFGetUGIDs(uid_t *euid, gid_t *egid);
4545

46-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
46+
#if TARGET_OS_MAC
4747
// CoreGraphics and LaunchServices are only projects (1 Dec 2006) that use these
4848
char **_CFArgv(void) { return *_NSGetArgv(); }
4949
int _CFArgc(void) { return *_NSGetArgc(); }
@@ -126,13 +126,13 @@ const char *_CFProcessPath(void) {
126126
}
127127
#endif
128128

129-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || DEPLOYMENT_TARGET_WINDOWS
129+
#if TARGET_OS_MAC || DEPLOYMENT_TARGET_WINDOWS
130130
CF_CROSS_PLATFORM_EXPORT Boolean _CFIsMainThread(void) {
131131
return pthread_main_np() == 1;
132132
}
133133
#endif
134134

135-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
135+
#if TARGET_OS_MAC
136136
const char *_CFProcessPath(void) {
137137
if (__CFProcessPath) return __CFProcessPath;
138138
#if TARGET_OS_OSX
@@ -206,7 +206,7 @@ CF_PRIVATE CFStringRef _CFProcessNameString(void) {
206206
}
207207

208208

209-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
209+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
210210

211211
#include <pwd.h>
212212
#include <sys/param.h>
@@ -262,7 +262,7 @@ CF_EXPORT CFStringRef CFGetUserName(void) {
262262

263263
CF_EXPORT CFStringRef CFCopyUserName(void) {
264264
CFStringRef result = NULL;
265-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
265+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
266266
uid_t euid;
267267
__CFGetUGIDs(&euid, NULL);
268268
struct passwd *upwd = getpwuid(euid ? euid : getuid());
@@ -332,7 +332,7 @@ CF_CROSS_PLATFORM_EXPORT CFStringRef CFCopyFullUserName(void) {
332332

333333

334334
CFURLRef CFCopyHomeDirectoryURL(void) {
335-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
335+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
336336
return _CFCopyHomeDirURLForUser(NULL, true);
337337
#elif DEPLOYMENT_TARGET_WINDOWS
338338
CFURLRef retVal = NULL;
@@ -412,7 +412,7 @@ CF_EXPORT CFURLRef CFCopyHomeDirectoryURLForUser(CFStringRef uName) {
412412
}
413413
}
414414
#endif
415-
#if TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_LINUX || TARGET_OS_BSD
415+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
416416
if (!uName) {
417417
return _CFCopyHomeDirURLForUser(NULL, true);
418418
} else {
@@ -612,7 +612,7 @@ CF_PRIVATE void __CFTSDInitialize() {
612612
#endif
613613

614614
static void __CFTSDSetSpecific(void *arg) {
615-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
615+
#if TARGET_OS_MAC
616616
pthread_setspecific(__CFTSDIndexKey, arg);
617617
#elif TARGET_OS_LINUX
618618
pthread_setspecific(__CFTSDIndexKey, arg);
@@ -622,7 +622,7 @@ static void __CFTSDSetSpecific(void *arg) {
622622
}
623623

624624
static void *__CFTSDGetSpecific() {
625-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
625+
#if TARGET_OS_MAC
626626
return pthread_getspecific(__CFTSDIndexKey);
627627
#elif TARGET_OS_LINUX
628628
return pthread_getspecific(__CFTSDIndexKey);
@@ -674,7 +674,7 @@ static void __CFTSDFinalize(void *arg) {
674674
#endif
675675
}
676676

677-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
677+
#if TARGET_OS_MAC
678678
extern int pthread_key_init_np(int, void (*)(void *));
679679
#endif
680680

@@ -1463,7 +1463,7 @@ typedef struct tagTHREADNAME_INFO
14631463
#endif
14641464

14651465
CF_CROSS_PLATFORM_EXPORT int _CFThreadSetName(_CFThreadRef thread, const char *_Nonnull name) {
1466-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
1466+
#if TARGET_OS_MAC
14671467
if (pthread_equal(pthread_self(), thread)) {
14681468
return pthread_setname_np(name);
14691469
}
@@ -1489,7 +1489,7 @@ CF_CROSS_PLATFORM_EXPORT int _CFThreadSetName(_CFThreadRef thread, const char *_
14891489
}
14901490

14911491
CF_CROSS_PLATFORM_EXPORT int _CFThreadGetName(char *buf, int length) {
1492-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
1492+
#if TARGET_OS_MAC
14931493
return pthread_getname_np(pthread_self(), buf, length);
14941494
#elif TARGET_OS_LINUX
14951495
return pthread_getname_np(pthread_self(), buf, length);
@@ -1498,7 +1498,7 @@ CF_CROSS_PLATFORM_EXPORT int _CFThreadGetName(char *buf, int length) {
14981498
}
14991499

15001500
CF_EXPORT char **_CFEnviron(void) {
1501-
#if TARGET_OS_OSX || TARGET_OS_IPHONE
1501+
#if TARGET_OS_MAC
15021502
return *_NSGetEnviron();
15031503
#elif DEPLOYMENT_TARGET_WINDOWS
15041504
return _environ;

0 commit comments

Comments
 (0)