Skip to content

Commit 60a9212

Browse files
authored
Add a missing include in Quaternion.cpp (#8423)
## Summary I've run into a build error when trying to create release builds of the example app: `Use of undeclared identifier 'std'` in `Quaternion.cpp` file. <img width="1722" height="490" alt="image" src="https://github.com/user-attachments/assets/3b448272-e259-4b0a-a79d-6ff5c494130e" /> A glance at the source code made me realize that we're calling functions like `std::sqrt`, `std::sin` etc. without importing `cmath` anywhere before. This error does not appear in debug builds. It seems to me that this is because in debug builds we are [importing `iostream` in the "if debug" condition](https://github.com/software-mansion/react-native-reanimated/blob/a9c36e69d37348eb80399ac9b63d81514326e858/packages/react-native-reanimated/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h#L4) and I assume that through that we indirectly import cmath as well. This PR adds an explicit `cmath` import to handle this issue. ## Test plan Signed-off-by: Oskar Pawica <[email protected]>
1 parent fa28817 commit 60a9212

File tree

1 file changed

+1
-0
lines changed
  • packages/react-native-reanimated/Common/cpp/reanimated/CSS/common/transforms

1 file changed

+1
-0
lines changed

packages/react-native-reanimated/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <reanimated/CSS/common/transforms/Quaternion.h>
2+
#include <cmath>
23

34
namespace reanimated::css {
45

0 commit comments

Comments
 (0)