Skip to content

Commit fedceec

Browse files
caodoanfacebook-github-bot
authored andcommitted
Correct some cpp imports (#52212)
Summary: Pull Request resolved: #52212 Correcting some C++ imports that show up when build with Xcode 26: - Missing `<string>` imports. - `<tgmath.h>` is a deprecated C++ header file, which in this case can be substituted with `<cmath>`. ## Changelog: [Internal] [iOS][Fixed] - Fix deprecated C++ imports Reviewed By: zhenma Differential Revision: D77192276 fbshipit-source-id: 30c836947cb3eb54f6e7ac42b87fd2493334a4f4
1 parent e3047db commit fedceec

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import <React/RCTUIManager.h>
1010
#import <React/RCTViewManager.h>
1111

12+
#import <string>
13+
1214
static UIColor *UIColorFromHexString(const std::string hexString)
1315
{
1416
unsigned rgbValue = 0;

packages/react-native/Libraries/Image/RCTImageURLLoaderWithAttribution.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
#import <React/RCTImageLoaderLoggable.h>
99
#import <React/RCTImageLoaderProtocol.h>
1010
#import <React/RCTImageURLLoader.h>
11-
1211
// TODO (T61325135): Remove C++ checks
1312
#ifdef __cplusplus
13+
#import <string>
14+
1415
namespace facebook::react {
1516

1617
struct ImageURLLoaderAttribution {

packages/react-native/Libraries/Image/RCTImageUtils.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#import <React/RCTImageUtils.h>
99

10-
#import <tgmath.h>
10+
#import <cmath>
1111

1212
#import <ImageIO/ImageIO.h>
1313
#import <MobileCoreServices/UTCoreTypes.h>

packages/react-native/React/Base/RCTUtils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <tgmath.h>
9-
108
#import <CoreGraphics/CoreGraphics.h>
119
#import <Foundation/Foundation.h>
1210
#import <UIKit/UIKit.h>

0 commit comments

Comments
 (0)