From 2ad242aa609006a70c8daec111da9fd00b57b42a Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 25 Aug 2026 03:45:45 -0700 Subject: [PATCH] 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 ` 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 --- .../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 dd0045542873..a2e74c15bfcb 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 4896a412cfca..747eac107641 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 2d4637b34398..180a4a9a7e79 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