Skip to content

Commit c6daa28

Browse files
committed
DEPLOYMENT_TARGET_WINDOWS -> TARGET_OS_WIN32
1 parent ddfc14e commit c6daa28

Some content is hidden

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

42 files changed

+286
-290
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
9393
set(Foundation_RPATH -Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN")
9494
set(XDG_TEST_HELPER_RPATH -Xlinker;-rpath;-Xlinker;${CMAKE_CURRENT_BINARY_DIR})
9595
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
96-
set(deployment_target -DDEPLOYMENT_TARGET_WINDOWS)
9796
# FIXME(SR9138) Silence "locally defined symbol '…' imported in function '…'
9897
set(WORKAROUND_SR9138 -Xlinker;-ignore:4049;-Xlinker;-ignore:4217)
9998
set(WORKAROUND_SR9995 -Xlinker;-nodefaultlib:libcmt)

CoreFoundation/Base.subproj/CFFileUtilities.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <string.h>
1818
#include <stdio.h>
1919

20-
#if DEPLOYMENT_TARGET_WINDOWS
20+
#if TARGET_OS_WIN32
2121
#include <io.h>
2222
#include <fcntl.h>
2323

@@ -46,7 +46,7 @@
4646
#endif
4747

4848
CF_INLINE int openAutoFSNoWait() {
49-
#if DEPLOYMENT_TARGET_WINDOWS
49+
#if TARGET_OS_WIN32
5050
return -1;
5151
#else
5252
return (__CFProphylacticAutofsAccess ? open("/dev/autofs_nowait", 0) : -1);
@@ -191,7 +191,7 @@ CF_PRIVATE Boolean _CFWriteBytesToFile(CFURLRef url, const void *bytes, CFIndex
191191
thread_set_errno(saveerr);
192192
return false;
193193
}
194-
#if DEPLOYMENT_TARGET_WINDOWS
194+
#if TARGET_OS_WIN32
195195
FlushFileBuffers((HANDLE)_get_osfhandle(fd));
196196
#else
197197
fsync(fd);
@@ -213,7 +213,7 @@ CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc,
213213
CFStringRef extension = (matchingAbstractType ? _CFCopyExtensionForAbstractType(matchingAbstractType) : NULL);
214214
CFIndex targetExtLen = (extension ? CFStringGetLength(extension) : 0);
215215

216-
#if DEPLOYMENT_TARGET_WINDOWS
216+
#if TARGET_OS_WIN32
217217
// This is a replacement for 'dirent' below, and also uses wchar_t to support unicode paths
218218
wchar_t extBuff[CFMaxPathSize];
219219
int extBuffInteriorDotCount = 0; //people insist on using extensions like ".trace.plist", so we need to know how many dots back to look :(
@@ -545,7 +545,7 @@ CF_PRIVATE SInt32 _CFGetPathProperties(CFAllocatorRef alloc, char *path, Boolean
545545

546546
if (modTime != NULL) {
547547
if (fileExists) {
548-
#if DEPLOYMENT_TARGET_WINDOWS || TARGET_OS_LINUX
548+
#if TARGET_OS_WIN32 || TARGET_OS_LINUX
549549
struct timespec ts = {statBuf.st_mtime, 0};
550550
#else
551551
struct timespec ts = statBuf.st_mtimespec;
@@ -599,7 +599,7 @@ CF_PRIVATE bool _CFURLExists(CFURLRef url) {
599599
return url && (0 == _CFGetFileProperties(kCFAllocatorSystemDefault, url, &exists, NULL, NULL, NULL, NULL, NULL)) && exists;
600600
}
601601

602-
#if DEPLOYMENT_TARGET_WINDOWS
602+
#if TARGET_OS_WIN32
603603
#define WINDOWS_PATH_SEMANTICS
604604
#else
605605
#define UNIX_PATH_SEMANTICS
@@ -1011,7 +1011,7 @@ CF_PRIVATE CFIndex _CFLengthAfterDeletingPathExtension(UniChar *unichars, CFInde
10111011
return ((0 < start) ? start : length);
10121012
}
10131013

1014-
#if DEPLOYMENT_TARGET_WINDOWS
1014+
#if TARGET_OS_WIN32
10151015
#define DT_DIR 4
10161016
#define DT_REG 8
10171017
#define DT_LNK 10
@@ -1023,7 +1023,7 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
10231023
char directoryPathBuf[CFMaxPathSize];
10241024
if (!CFStringGetFileSystemRepresentation(directoryPath, directoryPathBuf, CFMaxPathSize)) return;
10251025

1026-
#if DEPLOYMENT_TARGET_WINDOWS
1026+
#if TARGET_OS_WIN32
10271027
// Make sure there is room for the additional space we need in the win32 api
10281028
if (strlen(directoryPathBuf) > CFMaxPathSize - 2) return;
10291029

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ CF_PRIVATE CFIndex __CFActiveProcessorCount(void);
184184
#endif
185185
#endif
186186

187-
#if DEPLOYMENT_TARGET_WINDOWS
187+
#if TARGET_OS_WIN32
188188
#define __builtin_unreachable() do { } while (0)
189189
#endif
190190

@@ -400,14 +400,14 @@ extern const char *__CFgetenvIfNotRestricted(const char *n); // Returns NULL
400400
CF_PRIVATE Boolean __CFProcessIsRestricted(void);
401401

402402
// This is really about the availability of C99. We don't have that on Windows, but we should everywhere else.
403-
#if DEPLOYMENT_TARGET_WINDOWS
403+
#if TARGET_OS_WIN32
404404
#define STACK_BUFFER_DECL(T, N, C) T *N = (T *)_alloca((C) * sizeof(T))
405405
#else
406406
#define STACK_BUFFER_DECL(T, N, C) T N[C]
407407
#endif
408408

409409

410-
#if DEPLOYMENT_TARGET_WINDOWS
410+
#if TARGET_OS_WIN32
411411
#define SAFE_STACK_BUFFER_DECL(Type, Name, Count, Max) Type *Name; BOOL __ ## Name ## WasMallocd = NO; if (sizeof(Type) * Count > Max) { Name = (Type *)malloc((Count) * sizeof(Type)); __ ## Name ## WasMallocd = YES; } else Name = (Count > 0) ? _alloca((Count) * sizeof(Type)) : NULL
412412
#define SAFE_STACK_BUFFER_USE(Type, Name, Count, Max) if (sizeof(Type) * Count > Max) { Name = (Type *)malloc((Count) * sizeof(Type)); __ ## Name ## WasMallocd = YES; } else Name = (Count > 0) ? _alloca((Count) * sizeof(Type)) : NULL
413413
#define SAFE_STACK_BUFFER_CLEANUP(Name) if (__ ## Name ## WasMallocd) free(Name)
@@ -421,7 +421,7 @@ CF_PRIVATE Boolean __CFProcessIsRestricted(void);
421421

422422
// Be sure to call this before your SAFE_STACK_BUFFER exits scope.
423423
#define SAFE_STACK_BUFFER_CLEANUP(Name) if (__ ## Name ## WasMallocd) free(Name)
424-
#endif // !DEPLOYMENT_TARGET_WINDOWS
424+
#endif // !TARGET_OS_WIN32
425425

426426

427427
CF_EXPORT void * __CFConstantStringClassReferencePtr;
@@ -766,7 +766,7 @@ CF_EXPORT CFIndex _CFLengthAfterDeletingPathExtension(UniChar *unichars, CFIndex
766766
CF_PRIVATE CFArrayRef _CFCreateCFArrayByTokenizingString(const char *values, char delimiter);
767767

768768
#if __BLOCKS__
769-
#if DEPLOYMENT_TARGET_WINDOWS
769+
#if TARGET_OS_WIN32
770770
#define DT_DIR 4
771771
#define DT_REG 8
772772
#define DT_LNK 10
@@ -806,7 +806,7 @@ extern void _CFRuntimeSetInstanceTypeIDAndIsa(CFTypeRef cf, CFTypeID newTypeID);
806806
#define __has_attribute(...) 0
807807
#endif
808808

809-
#if DEPLOYMENT_TARGET_WINDOWS
809+
#if TARGET_OS_WIN32
810810
#define _CF_VISIBILITY_HIDDEN_ATTRIBUTE
811811
#elif __has_attribute(visibility)
812812
#define _CF_VISIBILITY_HIDDEN_ATTRIBUTE __attribute__((visibility("hidden")))
@@ -943,13 +943,13 @@ CF_PRIVATE bool __CFBinaryPlistIsArray(const uint8_t *databytes, uint64_t datale
943943
#endif
944944

945945
// Need to use the _O_BINARY flag on Windows to get the correct behavior
946-
#if DEPLOYMENT_TARGET_WINDOWS
946+
#if TARGET_OS_WIN32
947947
#define CF_OPENFLGS (_O_BINARY|_O_NOINHERIT)
948948
#else
949949
#define CF_OPENFLGS (0)
950950
#endif
951951

952-
#if DEPLOYMENT_TARGET_WINDOWS
952+
#if TARGET_OS_WIN32
953953

954954
// These are replacements for pthread calls on Windows
955955
CF_EXPORT int _NS_pthread_main_np();
@@ -975,12 +975,12 @@ CF_EXPORT bool _NS_pthread_equal(_CFThreadRef t1, _CFThreadRef t2);
975975
#define pthread_main_np _CFIsMainThread
976976
#endif
977977

978-
#if DEPLOYMENT_TARGET_WINDOWS
978+
#if TARGET_OS_WIN32
979979
CF_PRIVATE const wchar_t *_CFDLLPath(void);
980980
#endif
981981

982982
/* Buffer size for file pathname */
983-
#if DEPLOYMENT_TARGET_WINDOWS
983+
#if TARGET_OS_WIN32
984984
/// Use this constant for the size (in characters) of a buffer in which to hold a path. This size adds space for at least a couple of null terminators at the end of a buffer into which you copy up to kCFMaxPathLength characters.
985985
#define CFMaxPathSize ((CFIndex)262)
986986
/// Use this constant for the maximum length (in characters) of a path you want to copy into a buffer. This should be the maximum number of characters before the null terminator(s).
@@ -1026,7 +1026,7 @@ enum {
10261026
};
10271027
#endif
10281028

1029-
#if TARGET_OS_LINUX || DEPLOYMENT_TARGET_WINDOWS
1029+
#if TARGET_OS_LINUX || TARGET_OS_WIN32
10301030
#define QOS_CLASS_USER_INITIATED DISPATCH_QUEUE_PRIORITY_HIGH
10311031
#define QOS_CLASS_DEFAULT DISPATCH_QUEUE_PRIORITY_DEFAULT
10321032
#define QOS_CLASS_UTILITY DISPATCH_QUEUE_PRIORITY_LOW

CoreFoundation/Base.subproj/CFKnownLocations.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUs
4545
}
4646

4747
}
48-
#elif !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
48+
#elif !DEPLOYMENT_RUNTIME_OBJC && !TARGET_OS_WIN32 && !DEPLOYMENT_TARGET_ANDROID
4949

5050
/*
5151
Building for an OS that uses the FHS, BSD's hier(7), and/or the XDG specification for paths:
@@ -72,7 +72,7 @@ CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUs
7272
}
7373
}
7474

75-
#elif DEPLOYMENT_TARGET_WINDOWS
75+
#elif TARGET_OS_WIN32
7676

7777
switch (user) {
7878
case _kCFKnownLocationUserAny:

0 commit comments

Comments
 (0)