fix use of C++ syntax in an header file
Summary: All public header files can be included from Obj-C and Swift, except RCTSurfaceSizeMeasureMode.h which contains C++ code. Change is trivial and can be validated by review. None. [IOS][BUGFIX][{RCTSurfaceSizeMeasureMode.h}] - fix use of C++ syntax in an header file that could be included from Obj-C and Swift Closes https://github.com/facebook/react-native/pull/18730 Differential Revision: D7550290 Pulled By: shergin fbshipit-source-id: 3835e2c57697a067ff94afdaeaca06bce132ef66
This commit is contained in:
parent
4b6e9d3dfd
commit
bfcfe7961d
|
@ -70,8 +70,8 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
|
||||||
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
||||||
self.bounds.size,
|
self.bounds.size,
|
||||||
_sizeMeasureMode,
|
_sizeMeasureMode,
|
||||||
minimumSize,
|
&minimumSize,
|
||||||
maximumSize
|
&maximumSize
|
||||||
);
|
);
|
||||||
|
|
||||||
[_surface setMinimumSize:minimumSize
|
[_surface setMinimumSize:minimumSize
|
||||||
|
@ -107,8 +107,8 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
|
||||||
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
||||||
size,
|
size,
|
||||||
_sizeMeasureMode,
|
_sizeMeasureMode,
|
||||||
minimumSize,
|
&minimumSize,
|
||||||
maximumSize
|
&maximumSize
|
||||||
);
|
);
|
||||||
|
|
||||||
return [_surface sizeThatFitsMinimumSize:minimumSize
|
return [_surface sizeThatFitsMinimumSize:minimumSize
|
||||||
|
|
|
@ -28,6 +28,6 @@ typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) {
|
||||||
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
||||||
CGSize size,
|
CGSize size,
|
||||||
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
||||||
CGSize &minimumSize,
|
CGSize *minimumSize,
|
||||||
CGSize &maximumSize
|
CGSize *maximumSize
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,25 +12,25 @@
|
||||||
void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
||||||
CGSize size,
|
CGSize size,
|
||||||
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
||||||
CGSize &minimumSize,
|
CGSize *minimumSize,
|
||||||
CGSize &maximumSize
|
CGSize *maximumSize
|
||||||
) {
|
) {
|
||||||
minimumSize = CGSizeZero;
|
*minimumSize = CGSizeZero;
|
||||||
maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
|
*maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
|
||||||
|
|
||||||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
|
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
|
||||||
minimumSize.width = size.width;
|
minimumSize->width = size.width;
|
||||||
maximumSize.width = size.width;
|
maximumSize->width = size.width;
|
||||||
}
|
}
|
||||||
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
|
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
|
||||||
maximumSize.width = size.width;
|
maximumSize->width = size.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
|
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
|
||||||
minimumSize.height = size.height;
|
minimumSize->height = size.height;
|
||||||
maximumSize.height = size.height;
|
maximumSize->height = size.height;
|
||||||
}
|
}
|
||||||
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
|
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
|
||||||
maximumSize.height = size.height;
|
maximumSize->height = size.height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue