Skip to content

Commit 2ad242a

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Cover nativemodule/cputime with guards
Summary: Classifies `react/nativemodule/cputime:cputime` as a private target under the C++ stable API three-tier visibility model. Adds `#include <react/cxxstableapi/PrivateGuard.h>` to both of the module's exported headers (`CPUTime.h` and `NativeCPUTime.h`), and wires the guard dependency into BUCK and CMake. No pod ships this module and it is not exported through prefab, so there is no podspec or SwiftPM change to make. The guards are inert unless a consumer defines `RN_STRICT_API`, so there is no behavior change. Changelog: [Internal] Differential Revision: D117340507
1 parent e519d03 commit 2ad242a

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_include_directories(react_nativemodule_cpu PUBLIC ${REACT_COMMON_DIR})
1515

1616
target_link_libraries(react_nativemodule_cpu
1717
react_codegen_rncore
18+
react_cxxstableapi
1819
)
1920
target_compile_reactnative_options(react_nativemodule_cpu PRIVATE)
2021
target_compile_options(react_nativemodule_cpu PRIVATE -Wpedantic)

‎packages/react-native/ReactCommon/react/nativemodule/cputime/CPUTime.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/PrivateGuard.h>
11+
1012
#if defined USE_POSIX_TIME
1113
#include <time.h>
1214
#elif defined __MACH__

‎packages/react-native/ReactCommon/react/nativemodule/cputime/NativeCPUTime.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/PrivateGuard.h>
11+
1012
#if __has_include("rncoreJSI.h") // Cmake headers on Android
1113
#include "rncoreJSI.h"
1214
#elif __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple

0 commit comments

Comments
 (0)