Skip to content

Commit 0bc1ff4

Browse files
hantonfacebook-github-bot
authored andcommitted
Replace to use __BEGIN_DECLS and __END_DECLS (#938)
Summary: Replace all use cases of ``` #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } #endif ``` with ``` __BEGIN_DECLS ... __END_DECLS ``` keep its usage consistent in the project. Pull Request resolved: #938 Reviewed By: kevin0571 Differential Revision: D27115606 Pulled By: cuva fbshipit-source-id: b49fd9d3b88c0d77c12def1601ddf5d2eeb9f96e
1 parent d98c674 commit 0bc1ff4

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

ComponentKit/LayoutComponents/CKComponentLayoutBaseline.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,15 @@
1010

1111
#import <Foundation/Foundation.h>
1212

13-
#import <ComponentKit/CKDefines.h>
14-
15-
#if CK_NOT_SWIFT
13+
#import <RenderCore/CKDefines.h>
1614

1715
/**
1816
Set a key value pair using this in RCLayout.extra for a custom baseline. The component which uses this property should also override @{usesCustomBaseline} to return YES.
1917
e.g. @{kCKComponentLayoutExtraBaselineKey : 20}
2018
*/
2119

22-
#ifdef __cplusplus
23-
extern "C" {
24-
#endif
20+
CK_EXTERN_C_BEGIN
21+
2522
extern NSString *const kCKComponentLayoutExtraBaselineKey;
26-
#ifdef __cplusplus
27-
}
28-
#endif
2923

30-
#endif
24+
CK_EXTERN_C_END

ComponentKitTestHelpers/CKTestRunLoopRunning.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
*/
1010

1111
#import <Foundation/Foundation.h>
12+
#import <RenderCore/CKDefines.h>
1213

13-
#ifdef __cplusplus
14-
extern "C" {
15-
#endif
14+
CK_EXTERN_C_BEGIN
1615

1716
/**
1817
Runs the current thread's run loop until the block returns YES or a timeout is reached.
@@ -21,6 +20,4 @@ extern "C" {
2120
*/
2221
extern BOOL CKRunRunLoopUntilBlockIsTrue(BOOL (^block)(void));
2322

24-
#ifdef __cplusplus
25-
}
26-
#endif
23+
CK_EXTERN_C_END

ComponentKitTests/CKComponentHostingViewTestModel.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ CK_INIT_UNAVAILABLE;
4343

4444
@class CKComponent;
4545

46-
#ifdef __cplusplus
47-
extern "C" {
48-
#endif
46+
CK_EXTERN_C_BEGIN
4947

5048
CKComponent *CKComponentWithHostingViewTestModel(CKComponentHostingViewTestModel *model);
5149

52-
#ifdef __cplusplus
53-
}
54-
#endif
50+
CK_EXTERN_C_END

RenderCore/Utilities/CKWeakObjectContainer.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
*/
1010

1111
#import <Foundation/Foundation.h>
12+
#import <RenderCore/CKDefines.h>
1213

1314
@interface CKWeakObjectContainer : NSObject
1415
@property (readonly, nonatomic, weak) id object;
1516
+ (instancetype)newWithObject:(id)object;
1617
@end
1718

18-
#ifdef __cplusplus
19-
extern "C" {
20-
#endif
19+
CK_EXTERN_C_BEGIN
2120

2221
extern void ck_objc_setNonatomicAssociatedWeakObject(id container, void *key, id value);
2322
extern void ck_objc_setAssociatedWeakObject(id container, void *key, id value);
2423
extern id ck_objc_getAssociatedWeakObject(id container, void *key);
2524

26-
#ifdef __cplusplus
27-
}
28-
#endif
25+
CK_EXTERN_C_END

0 commit comments

Comments
 (0)