Skip to content

Commit bde9c3b

Browse files
authored
[cxx-interop] Fix header guards in test/Interop (swiftlang#35039)
1 parent 81107e4 commit bde9c3b

23 files changed

+89
-25
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#ifndef TEST_INTEROP_C_CHARS_INPUTS_IMPORT_CCHAR_TYPES_H
2+
#define TEST_INTEROP_C_CHARS_INPUTS_IMPORT_CCHAR_TYPES_H
3+
14
#include <stddef.h>
25

36
extern char a_char;
47
extern wchar_t a_wchar;
8+
9+
#endif // TEST_INTEROP_C_CHARS_INPUTS_IMPORT_CCHAR_TYPES_H

test/Interop/C/macros/Inputs/redefined-macro.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_C_MACROS_INPUTS_REDEFINED_MACRO_H
2+
#define TEST_INTEROP_C_MACROS_INPUTS_REDEFINED_MACRO_H
3+
14
#define FOO 0
25
#define TMP_FOO FOO
36
#undef FOO
@@ -12,4 +15,5 @@
1215
#define THREE THE_MAX
1316

1417
#define BAR 0
15-
#define BAZ BAR
18+
#define BAZ BAR
19+
#endif // TEST_INTEROP_C_MACROS_INPUTS_REDEFINED_MACRO_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
#ifndef TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_A_H
2+
#define TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_A_H
3+
14
#include "textual-header.h"
5+
6+
#endif // TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_A_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
#ifndef TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_B_H
2+
#define TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_B_H
3+
14
#include "textual-header.h"
5+
6+
#endif // TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_FOREIGN_B_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
#ifndef TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_TEXTUAL_HEADER_H
2+
#define TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_TEXTUAL_HEADER_H
3+
14
struct ForeignStruct {};
5+
6+
#endif // TEST_INTEROP_C_MODULES_PRINT_QUALIFIED_CLANG_TYPES_INPUTS_TEXTUAL_HEADER_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_OBJC_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_OBJC_H
3+
14
#import <Foundation.h>
25

36
struct ConstructorWithNSArrayParam {
47
ConstructorWithNSArrayParam(NSArray *array) {}
58
};
9+
10+
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_OBJC_H

test/Interop/Cxx/class/Inputs/constructors.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_H
3+
14
struct ExplicitDefaultConstructor {
25
ExplicitDefaultConstructor() : x(42) {}
36
int x;
@@ -65,3 +68,5 @@ struct TemplatedConstructorWithExtraArg {
6568
struct UsingBaseConstructor : ConstructorWithParam {
6669
using ConstructorWithParam::ConstructorWithParam;
6770
};
71+
72+
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_DEBUG_INFO_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_DEBUG_INFO_H
3+
14
struct IntWrapper {
25
int value;
36
};
7+
8+
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_DEBUG_INFO_H

test/Interop/Cxx/class/Inputs/nested-records.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_NESTED_RECORDS_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_NESTED_RECORDS_H
3+
14
struct S1 {
25
struct S2 {
36
bool A : 1;
@@ -43,3 +46,5 @@ struct S10 {
4346
};
4447

4548
// TODO: Nested class templates (SR-13853).
49+
50+
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_NESTED_RECORDS_H
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_PROTOCOL_CONFORMANCE_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_PROTOCOL_CONFORMANCE_H
3+
14
struct ConformsToProtocol {
25
int return42() { return 42; }
36
};
47

58
struct DoesNotConformToProtocol {
69
int returnFortyTwo() { return 42; }
710
};
11+
12+
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_PROTOCOL_CONFORMANCE_H

0 commit comments

Comments
 (0)