From e54aea474ff005612ab767fbcf0b3d785cda088a Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Wed, 2 Sep 2026 01:38:34 -0700 Subject: [PATCH] Cover `nativemodule/cputime` with guards (#58142) Summary: Pull Request resolved: https://github.com/react/react-native/pull/58142 Classifies `react/nativemodule/cputime:cputime` as a private target under the C++ stable API three-tier visibility model. Adds `#include ` 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] Reviewed By: cortinico Differential Revision: D117340507 fbshipit-source-id: 559c7f74bbcdc67d8fef1a3f4e291f260c9e92ac --- .../ReactCommon/react/nativemodule/cputime/CMakeLists.txt | 1 + .../ReactCommon/react/nativemodule/cputime/CPUTime.h | 2 ++ .../ReactCommon/react/nativemodule/cputime/NativeCPUTime.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt index dd004554287..a2e74c15bfc 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt @@ -15,6 +15,7 @@ target_include_directories(react_nativemodule_cpu PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_nativemodule_cpu react_codegen_rncore + react_cxxstableapi ) target_compile_reactnative_options(react_nativemodule_cpu PRIVATE) target_compile_options(react_nativemodule_cpu PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCommon/react/nativemodule/cputime/CPUTime.h b/packages/react-native/ReactCommon/react/nativemodule/cputime/CPUTime.h index 4896a412cfc..747eac10764 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/cputime/CPUTime.h +++ b/packages/react-native/ReactCommon/react/nativemodule/cputime/CPUTime.h @@ -7,6 +7,8 @@ #pragma once +#include + #if defined USE_POSIX_TIME #include #elif defined __MACH__ diff --git a/packages/react-native/ReactCommon/react/nativemodule/cputime/NativeCPUTime.h b/packages/react-native/ReactCommon/react/nativemodule/cputime/NativeCPUTime.h index 2d4637b3439..180a4a9a7e7 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/cputime/NativeCPUTime.h +++ b/packages/react-native/ReactCommon/react/nativemodule/cputime/NativeCPUTime.h @@ -7,6 +7,8 @@ #pragma once +#include + #if __has_include("rncoreJSI.h") // Cmake headers on Android #include "rncoreJSI.h" #elif __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple