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

Add missing cmath includes #497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HuYuxin
Copy link
Contributor

@HuYuxin HuYuxin commented Nov 4, 2024

This fixes the compilation errors in chromium and ANGLE:

glcTextureStorageTests.cpp:76:35: error: no member named 'floor' in namespace 'std'
glcTextureStorageTests.cpp:76:46: error: no member named 'log2f' in namespace 'std'

This fixes the compilation errors in chromium and ANGLE:

glcTextureStorageTests.cpp:76:35: error: no member named 'floor' in namespace 'std'
glcTextureStorageTests.cpp:76:46: error: no member named 'log2f' in namespace 'std'
@ao2
Copy link
Contributor

ao2 commented Nov 19, 2024

When building for Android similar errors also show up for glcFramebufferBlitTests.cpp and glcTextureLodBiasTests.cpp:

.../external/openglcts/modules/common/glcFramebufferBlitTests.cpp:715:26: error: no member named 'floor' in namespace 'std'
    return (GLubyte)std::floor(f == 1.0f ? 255 : f * 255.0);
                    ~~~~~^
.../external/openglcts/modules/common/glcFramebufferBlitTests.cpp:1491:14: error: no member named 'fabs' in namespace 'std'
    if (std::fabs(actual - expected) > eps)
        ~~~~~^
2 errors generated.

@HuYuxin can you also add this change to the PR?:

diff --git a/external/openglcts/modules/common/glcFramebufferBlitTests.cpp b/external/openglcts/modules/common/glcFramebufferBlitTests.cpp
index 7accfaa..9c0b3a8 100644
--- a/external/openglcts/modules/common/glcFramebufferBlitTests.cpp
+++ b/external/openglcts/modules/common/glcFramebufferBlitTests.cpp
@@ -41,6 +41,8 @@
 #include "tcuRenderTarget.hpp"
 #include "tcuStringTemplate.hpp"
 
+#include <cmath>
+
 #define CHECK(actual, expected, info)                                                                          \
     {                                                                                                          \
         result &= ((actual) != (expected)) ? false : true;                                                     \
diff --git a/external/openglcts/modules/common/glcTextureLodBiasTests.cpp b/external/openglcts/modules/common/glcTextureLodBiasTests.cpp
index bcf4330..0875bf4 100644
--- a/external/openglcts/modules/common/glcTextureLodBiasTests.cpp
+++ b/external/openglcts/modules/common/glcTextureLodBiasTests.cpp
@@ -39,6 +39,8 @@
 #include "tcuTestLog.hpp"
 #include "tcuStringTemplate.hpp"
 
+#include <cmath>
+
 using namespace glw;
 using namespace glu;
 

Thanks, Antonio

@ao2
Copy link
Contributor

ao2 commented Nov 27, 2024

Ah, I see that the changes that I needed for Android are already in the main branch: 6164879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants