Skip to content

Commit 3324cd5

Browse files
committed
CoreFoundation: use #include instead of #import
`#import` when building for Windows will be treated as the import of a type library rather than the semantics of Objective-C style `#import` which does an include once type of operation. Convert to the `#include` syntax instead to allow this to be built on Windows as well (e.g. via clang-cl).
1 parent 525f150 commit 3324cd5

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CF_EXTERN_C_BEGIN
110110
#include <pthread.h>
111111

112112
#if !DEPLOYMENT_RUNTIME_SWIFT && __has_include(<os/log.h>)
113-
#import <os/log.h>
113+
#include <os/log.h>
114114
#else
115115
typedef struct os_log_s *os_log_t;
116116
#define os_log(...) do { } while (0)

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ CF_PRIVATE int asprintf(char **ret, const char *format, ...) {
13111311
#endif
13121312

13131313
#if DEPLOYMENT_RUNTIME_SWIFT
1314-
#import <fcntl.h>
1314+
#include <fcntl.h>
13151315

13161316
extern void swift_retain(void *);
13171317
extern void swift_release(void *);

CoreFoundation/Base.subproj/CFUtilities.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#include <crt_externs.h>
4747
#include <dlfcn.h>
4848
#include <vproc.h>
49-
#import <libproc.h>
49+
#include <libproc.h>
5050
#include <sys/sysctl.h>
5151
#include <sys/stat.h>
5252
#include <mach/mach.h>

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ typedef char * Class;
7474
#define CRSetCrashLogMessage2(A) do {} while (0)
7575

7676
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
77-
#import <libkern/OSAtomic.h>
78-
#import <pthread.h>
77+
#include <libkern/OSAtomic.h>
78+
#include <pthread.h>
7979
#endif
8080

8181

CoreFoundation/Collections.subproj/CFBasicHash.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
Responsibility: Christopher Kane
99
*/
1010

11-
#import "CFBasicHash.h"
12-
#import <CoreFoundation/CFRuntime.h>
13-
#import "CFRuntime_Internal.h"
14-
#import <CoreFoundation/CFSet.h>
15-
#import <Block.h>
16-
#import <math.h>
11+
#include "CFBasicHash.h"
12+
#include <CoreFoundation/CFRuntime.h>
13+
#include "CFRuntime_Internal.h"
14+
#include <CoreFoundation/CFSet.h>
15+
#include <Block.h>
16+
#include <math.h>
1717
#if __HAS_DISPATCH__
18-
#import <dispatch/dispatch.h>
18+
#include <dispatch/dispatch.h>
1919
#endif
20-
#import "CFOverflow.h"
20+
#include "CFOverflow.h"
2121

2222
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
2323
#define __SetLastAllocationEventName(A, B) do { if (__CFOASafe && (A)) __CFSetLastAllocationEventName(A, B); } while (0)

CoreFoundation/Collections.subproj/CFData.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#endif
2525

2626
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
27-
#import <mach/mach.h>
27+
#include <mach/mach.h>
2828
CF_INLINE unsigned long __CFPageSize() { return vm_page_size; }
2929
#elif DEPLOYMENT_TARGET_WINDOWS
3030
CF_INLINE unsigned long __CFPageSize() {

CoreFoundation/Parsing.subproj/CFPropertyList_Private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
*/
99

10-
#import <CoreFoundation/CFPropertyList.h>
10+
#include <CoreFoundation/CFPropertyList.h>
1111

1212
// this is only allowed the first 8 bits
1313
typedef CF_OPTIONS(CFOptionFlags, CFPropertyListSupportedFormats) {

CoreFoundation/RunLoop.subproj/CFMachPort_Lifetime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
All of the functions in this file exist to orchestrate the exact time/circumstances we decrement the port references.
66
*/
77

8-
#import "CFMachPort_Lifetime.h"
9-
#import <mach/mach.h>
10-
#import "CFInternal.h"
8+
#include "CFMachPort_Lifetime.h"
9+
#include <mach/mach.h>
10+
#include "CFInternal.h"
1111

1212
// Records information relevant for cleaning up after a given mach port. Here's
1313
// a summary of its life cycle:

CoreFoundation/String.subproj/CFAttributedString.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "CFRuntime_Internal.h"
1818

1919
#if (TARGET_OS_MAC || TARGET_OS_WIN32) && DEPLOYMENT_RUNTIME_OBJC
20-
#import <Foundation/NSAttributedString.h>
20+
#include <Foundation/NSAttributedString.h>
2121
@interface NSAttributedString (NSPrivate)
2222
- (NSAttributedString *)_createAttributedSubstringWithRange:(NSRange)range;
2323
@end

0 commit comments

Comments
 (0)