Skip to content

Commit b87fc0b

Browse files
committed
Revert "Remove Darwin module's dependency on ctypes.h"
This reverts commit 24591ef. This is slightly different than the commit on master. Reverting prior to merging in master.
1 parent f5c1387 commit b87fc0b

File tree

7 files changed

+6
-46
lines changed

7 files changed

+6
-46
lines changed

test/ClangModules/Inputs/custom-modules/Redeclaration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ typedef struct CGPoint CGPoint;
55
typedef CGPoint NSPoint;
66
NSString *NSStringToNSString(NSString *str);
77

8-
struct FooStructA {
8+
struct FooStruct1 {
99
int x;
1010
double y;
1111
};

test/ClangModules/MixedSource/Inputs/mixed-with-header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public func testProtocolWrapper(_ conformer: ForwardClassUser) {
2424
conformer.consumeForwardClass(conformer.forward)
2525
}
2626

27-
public func testStruct(_ p: Darwin.Point) -> Darwin.Point {
27+
public func testStruct(_ p: Point) -> Point {
2828
var result = p
2929
result.y += 5
3030
return result

test/ClangModules/MixedSource/import-mixed-with-header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ func testCrossReferences(_ derived: Derived) {
2727
_ = obj.safeOverrideProto(ForwardProtoAdopter()) as NSObject
2828

2929
testProtocolWrapper(ProtoConformer())
30-
_ = testStruct(Darwin.Point(x: 2,y: 3))
30+
_ = testStruct(Point(x: 2,y: 3))
3131
}

test/ClangModules/MixedSource/mixed-target-using-header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func testProtocolWrapper(_ conformer: ForwardClassUser) {
3939
}
4040
testProtocolWrapper(ProtoConformer())
4141

42-
func testStruct(_ p: Darwin.Point) -> Darwin.Point {
42+
func testStruct(_ p: Point) -> Point {
4343
var result = p
4444
result.y += 5
4545
return result

test/ClangModules/adapter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ let encoding: UInt = NSUTF8StringEncoding
1717
let viaTypedef: Redeclaration.NSPoint = AppKit.NSPoint(x: 0, y: 0)
1818
Redeclaration.NSStringToNSString(AppKit.NSStringToNSString("abc")) // expected-warning {{result of call is unused}}
1919

20-
let viaStruct: Redeclaration.FooStructA = AppKit.FooStructA()
20+
let viaStruct: Redeclaration.FooStruct1 = AppKit.FooStruct1()
2121
let forwardDecl: Redeclaration.Tribool = AppKit.Tribool() // expected-error {{no type named 'Tribool' in module 'Redeclaration'}}

test/Inputs/clang-importer-sdk/usr/include/MacTypes.h

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,7 @@
11
#ifndef __MACTYPES__
22
#define __MACTYPES__
33

4-
#define STDLIB_TEST(TYPE, NAME) extern NAME NAME##_test
5-
#define STDLIB_TYPEDEF(TYPE, NAME) \
6-
typedef TYPE NAME; \
7-
STDLIB_TEST(TYPE, NAME)
8-
9-
STDLIB_TYPEDEF(__INT8_TYPE__, SInt8);
10-
STDLIB_TYPEDEF(__INT16_TYPE__, SInt16);
11-
STDLIB_TYPEDEF(__INT32_TYPE__, SInt32);
12-
13-
STDLIB_TYPEDEF(__UINT8_TYPE__, UInt8);
14-
STDLIB_TYPEDEF(__UINT16_TYPE__, UInt16);
15-
STDLIB_TYPEDEF(__UINT32_TYPE__, UInt32);
16-
17-
#include <stdint.h>
18-
19-
#if !defined(__have_Point)
20-
#define __have_Point
21-
struct Point {
22-
float x;
23-
float y;
24-
};
25-
#endif
26-
27-
/*!
28-
@keyword FooA, StructA
29-
*/
30-
struct FooStructA {
31-
/*!
32-
@keyword x, StructA
33-
@recommended y
34-
*/
35-
int x;
36-
/*!
37-
@keyword y, StructA
38-
@recommendedover x
39-
*/
40-
double y;
41-
};
4+
#include "ctypes.h"
425

436
typedef SInt32 Fixed;
447
typedef Fixed * FixedPtr;

test/Inputs/clang-importer-sdk/usr/include/ctypes.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ enum {
1717
AnonConstSmall2
1818
};
1919

20-
#if !defined(__have_Point)
21-
#define __have_Point
2220
struct Point {
2321
float x;
2422
float y;
2523
};
26-
#endif
2724

2825
typedef struct {
2926
struct {

0 commit comments

Comments
 (0)