Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fuseCut] Pick isnormal() from std namespace #1228

Merged
merged 1 commit into from
Sep 17, 2022

Conversation

p12tic
Copy link
Contributor

@p12tic p12tic commented Sep 17, 2022

This fixes compile error due to isnormal() being not available in the global namespace. Errors like this most often occur because we accidentally rely on what headers the standard library headers include internally.

@simogasp simogasp added this to the 2.5.0 milestone Sep 17, 2022
@@ -1629,7 +1629,7 @@ DelaunayGraphCut::GeometryIntersection DelaunayGraphCut::rayIntersectTriangle(co
Point3d tempIntersectPt;
const Point2d triangleUv = getLineTriangleIntersectBarycCoords(&tempIntersectPt, A, B, C, &originPt, &DirVec);

if (!isnormal(tempIntersectPt.x) || !isnormal(tempIntersectPt.y) || !isnormal(tempIntersectPt.z))
if (!std::isnormal(tempIntersectPt.x) || !std::isnormal(tempIntersectPt.y) || !std::isnormal(tempIntersectPt.z))
Copy link
Member

@simogasp simogasp Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also #include <cmath> so that we are sure it is included and thus we do not rely on other includes to import the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. This is fixed now.

This fixes compile error due to isnormal() being not available in the
global namespace.
@fabiencastan fabiencastan merged commit 22fd9d4 into alicevision:develop Sep 17, 2022
@p12tic p12tic deleted the isnormal-compile-error branch September 29, 2022 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants