[CGPointNull] Rename globally exported C function to avoid collisions #trivial (#62)

* [CGPointNull] Rename globally exported C function to avoid collisions.

Some other frameworks also declare this. Let's try to minimize collisions
without making the name too ugly.

* Fix build errors
This commit is contained in:
appleguy 2017-04-26 17:21:01 -07:00 committed by Adlai Holler
parent fbb14f5c7c
commit 32c036f440
2 changed files with 8 additions and 8 deletions

View File

@ -24,9 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
ASDISPLAYNODE_EXTERN_C_BEGIN ASDISPLAYNODE_EXTERN_C_BEGIN
extern CGPoint const CGPointNull; extern CGPoint const ASPointNull; // {NAN, NAN}
extern BOOL CGPointIsNull(CGPoint point); extern BOOL ASPointIsNull(CGPoint point);
/** /**
* Safely calculates the layout of the given root layoutElement by guarding against nil nodes. * Safely calculates the layout of the given root layoutElement by guarding against nil nodes.

View File

@ -27,9 +27,9 @@
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h> #import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
#import <AsyncDisplayKit/ASRectTable.h> #import <AsyncDisplayKit/ASRectTable.h>
CGPoint const CGPointNull = {NAN, NAN}; CGPoint const ASPointNull = {NAN, NAN};
extern BOOL CGPointIsNull(CGPoint point) extern BOOL ASPointIsNull(CGPoint point)
{ {
return isnan(point.x) && isnan(point.y); return isnan(point.x) && isnan(point.y);
} }
@ -87,7 +87,7 @@ static inline NSString * descriptionIndents(NSUInteger indents)
if (self) { if (self) {
#if DEBUG #if DEBUG
for (ASLayout *sublayout in sublayouts) { for (ASLayout *sublayout in sublayouts) {
ASDisplayNodeAssert(CGPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout."); ASDisplayNodeAssert(ASPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout.");
} }
#endif #endif
@ -104,7 +104,7 @@ static inline NSString * descriptionIndents(NSUInteger indents)
} }
_size = size; _size = size;
if (CGPointIsNull(position) == NO) { if (ASPointIsNull(position) == NO) {
_position = CGPointMake(ASCeilPixelValue(position.x), ASCeilPixelValue(position.y)); _position = CGPointMake(ASCeilPixelValue(position.x), ASCeilPixelValue(position.y));
} else { } else {
_position = position; _position = position;
@ -149,7 +149,7 @@ static inline NSString * descriptionIndents(NSUInteger indents)
{ {
return [self layoutWithLayoutElement:layoutElement return [self layoutWithLayoutElement:layoutElement
size:size size:size
position:CGPointNull position:ASPointNull
sublayouts:sublayouts]; sublayouts:sublayouts];
} }
@ -157,7 +157,7 @@ static inline NSString * descriptionIndents(NSUInteger indents)
{ {
return [self layoutWithLayoutElement:layoutElement return [self layoutWithLayoutElement:layoutElement
size:size size:size
position:CGPointNull position:ASPointNull
sublayouts:nil]; sublayouts:nil];
} }