Skip to content

Commit

Permalink
Convert the codebase to Objective-C++ (#1206)
Browse files Browse the repository at this point in the history
* Convert the codebase to Objective-C++ throughout. One language is better than two.

* Put it back

* Fix linker

* Point explicitly to updated Weaver to unblock build

* Revert "Point explicitly to updated Weaver to unblock build"

This reverts commit fdc2529.

* Revert "Fix linker"

This reverts commit 7be25f9.

* Add in the frameworks

* no message

* Address spec lint warnings

* Fix tvos build

* Put that back

* Address Michael's review

* Add comment to kick CI
  • Loading branch information
Adlai-Holler committed Nov 2, 2018
1 parent 7ccdcb9 commit d0ba092
Show file tree
Hide file tree
Showing 155 changed files with 841 additions and 846 deletions.
1,220 changes: 624 additions & 596 deletions AsyncDisplayKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
- Correct linePositionModifier behavior [Michael Schneider](https://github.com/maicki)[#1192] (https://github.com/TextureGroup/Texture/pull/1192)
- Tweak a11y label aggregation behavior to enable container label overrides [Michael Schneider](https://github.com/maicki)[#1199] (https://github.com/TextureGroup/Texture/pull/1199)
- Fix logic cleaning data if delegate / dataSource changes and bring over logic to ASTableView [Michael Schneider](https://github.com/maicki)[#1200] (https://github.com/TextureGroup/Texture/pull/1200)
- Standardize the code base on Objective-C++. We will still not leak any C++ into public headers, however. [Adlai Holler](https://github.com/Adlai-Holler)

## 2.7
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCGImageBuffer.m → Source/ASCGImageBuffer.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASCGImageBuffer.m
// ASCGImageBuffer.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions Source/ASCollections.m → Source/ASCollections.mm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// ASCollections.m
// ASCollections.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import "ASCollections.h"
#import <AsyncDisplayKit/ASCollections.h>

/**
* A private allocator that signals to our retain callback to skip the retain.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASConfiguration.m → Source/ASConfiguration.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASConfiguration.m
// ASConfiguration.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASConfigurationInternal.m
// ASConfigurationInternal.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASDisplayNode+Convenience.m
// ASDisplayNode+Convenience.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASExperimentalFeatures.m
// ASExperimentalFeatures.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASNavigationController.m
// ASNavigationController.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASNetworkImageLoadInfo.m
// ASNetworkImageLoadInfo.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASPagerFlowLayout.m → Source/ASPagerFlowLayout.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASPagerFlowLayout.m
// ASPagerFlowLayout.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASPagerNode.m → Source/ASPagerNode.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASPagerNode.m
// ASPagerNode.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASTabBarController.m
// ASTabBarController.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASVideoPlayerNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ NS_ASSUME_NONNULL_BEGIN

@end
NS_ASSUME_NONNULL_END
#endif
#endif // TARGET_OS_IOS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASVisibilityProtocols.m
// ASVisibilityProtocols.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions Source/Base/ASAssert.m → Source/Base/ASAssert.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASAssert.m
// ASAssert.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down Expand Up @@ -39,19 +39,19 @@ static pthread_key_t ASMainThreadAssertionsDisabledKey() {
}

BOOL ASMainThreadAssertionsAreDisabled() {
return (pthread_getspecific(ASMainThreadAssertionsDisabledKey()) > 0);
return (nullptr != pthread_getspecific(ASMainThreadAssertionsDisabledKey()));
}

void ASPushMainThreadAssertionsDisabled() {
let key = ASMainThreadAssertionsDisabledKey();
let oldVal = pthread_getspecific(key);
pthread_setspecific(key, oldVal + 1);
let oldVal = (intptr_t)pthread_getspecific(key);
pthread_setspecific(key, (void *)(oldVal + 1));
}

void ASPopMainThreadAssertionsDisabled() {
let key = ASMainThreadAssertionsDisabledKey();
let oldVal = pthread_getspecific(key);
pthread_setspecific(key, oldVal - 1);
let oldVal = (intptr_t)pthread_getspecific(key);
pthread_setspecific(key, (void *)(oldVal - 1));
ASDisplayNodeCAssert(oldVal > 0, @"Attempt to pop thread assertion-disabling without corresponding push.");
}

Expand Down
1 change: 1 addition & 0 deletions Source/Base/ASBaseDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define AS_EXTERN FOUNDATION_EXTERN
#define unowned __unsafe_unretained

// TODO: Remove these now that we're all-C++.
#if defined(__cplusplus)
# define var auto
# define let const auto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASDisplayNode+Ancestry.m
// ASDisplayNode+Ancestry.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/Base/ASLog.m → Source/Base/ASLog.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASLog.m
// ASLog.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AsyncDisplayKit+Debug.m
// AsyncDisplayKit+Debug.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// AsyncDisplayKit+Tips.m
// AsyncDisplayKit+Tips.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import "AsyncDisplayKit+Tips.h"
#import <AsyncDisplayKit/AsyncDisplayKit+Tips.h>
#import <AsyncDisplayKit/ASDisplayNode+Ancestry.h>

@implementation ASDisplayNode (Tips)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASBatchContext.m
// ASBatchContext.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASCollectionFlowLayoutDelegate.m
// ASCollectionFlowLayoutDelegate.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASCollectionLayoutContext.m
// ASCollectionLayoutContext.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASCollectionViewLayoutController.m
// ASCollectionViewLayoutController.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASCollectionViewLayoutInspector.m
// ASCollectionViewLayoutInspector.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASDelegateProxy.m
// ASDelegateProxy.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// ASElementMap.m
// ASElementMap.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import "ASElementMap.h"
#import <AsyncDisplayKit/ASElementMap.h>
#import <UIKit/UIKit.h>
#import <AsyncDisplayKit/ASCollectionElement.h>
#import <AsyncDisplayKit/ASTwoDimensionalArrayUtils.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// ASGraphicsContext.m
// ASGraphicsContext.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import "ASGraphicsContext.h"
#import <AsyncDisplayKit/ASGraphicsContext.h>
#import <AsyncDisplayKit/ASCGImageBuffer.h>
#import <AsyncDisplayKit/ASAssert.h>
#import <AsyncDisplayKit/ASConfigurationInternal.h>
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASHashing.m → Source/Details/ASHashing.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASHashing.m
// ASHashing.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASImageContainerProtocolCategories.m
// ASImageContainerProtocolCategories.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASMutableAttributedStringBuilder.m
// ASMutableAttributedStringBuilder.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASObjectDescriptionHelpers.m
// ASObjectDescriptionHelpers.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASPINRemoteImageDownloader.m
// ASPINRemoteImageDownloader.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASPageTable.m
// ASPageTable.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASPhotosFrameworkImageRequest.m
// ASPhotosFrameworkImageRequest.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASRecursiveUnfairLock.m
// ASRecursiveUnfairLock.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASScrollDirection.m
// ASScrollDirection.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASTableLayoutController.m
// ASTableLayoutController.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASTraceEvent.m
// ASTraceEvent.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASTraitCollection.m
// ASTraitCollection.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASWeakProxy.m
// ASWeakProxy.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASWeakSet.m → Source/Details/ASWeakSet.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ASWeakSet.m
// ASWeakSet.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
11 changes: 0 additions & 11 deletions Source/Details/CoreGraphics+ASConvenience.m

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NSIndexSet+ASHelpers.m
// NSIndexSet+ASHelpers.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NSMutableAttributedString+TextKitAdditions.m
// NSMutableAttributedString+TextKitAdditions.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// _ASAsyncTransactionContainer.m
// _ASAsyncTransactionContainer.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// _ASAsyncTransactionGroup.m
// _ASAsyncTransactionGroup.mm
// Texture
//
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
Expand Down
Loading

0 comments on commit d0ba092

Please sign in to comment.