mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove CGFLOAT_IS_DOUBLE macro (#50017)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50017 [From iOS 11 onwards and from MacOS 10.15](https://developer.apple.com/documentation/uikit/updating-your-app-from-32-bit-to-64-bit-architecture?language=objc), Apple only supports 64 bit architectures. Hence, [`CGFloat` is now always mapped to a Double](https://developer.apple.com/documentation/corefoundation/cgfloat-swift.struct?language=objc#overview) and it is now safe to remove the macro. ## Changelog [Internal] - Remove usages of `CGFLOAT_IS_DOUBLE` Reviewed By: javache Differential Revision: D71128583 fbshipit-source-id: bad805b941451ab84a68912f6d72149bfd7753ec
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a6e854efe9
commit
54b22211dc
@@ -78,5 +78,5 @@ CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp)
|
||||
|
||||
NSNumber *baseSize =
|
||||
mapping[@(dynamicTypeRamp)] ?: @17; // Default to body size if we don't recognize the specified ramp
|
||||
return CGFLOAT_IS_DOUBLE ? [baseSize doubleValue] : [baseSize floatValue];
|
||||
return [baseSize doubleValue];
|
||||
}
|
||||
|
||||
@@ -94,11 +94,7 @@ BOOL RCTHasFontHandlerSet()
|
||||
// which one we actually have.
|
||||
static inline BOOL CompareFontWeights(UIFontWeight firstWeight, UIFontWeight secondWeight)
|
||||
{
|
||||
#if CGFLOAT_IS_DOUBLE
|
||||
return fabs(firstWeight - secondWeight) < 0.01;
|
||||
#else
|
||||
return fabsf(firstWeight - secondWeight) < 0.01;
|
||||
#endif
|
||||
}
|
||||
|
||||
static NSString *FontWeightDescriptionFromUIFontWeight(UIFontWeight fontWeight)
|
||||
|
||||
Reference in New Issue
Block a user