From b0245f1a28764cf0438e34a0d5669dd405c698bc Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Tue, 26 Aug 2025 17:35:48 +0100 Subject: [PATCH] Rename Version major and minor getters (#2451) Both these functions cause a conflict when using an old version of the GNU C Library with the header file sys/sysmacros.h where major() and minor() are defined as a macro --- test_common/harness/testHarness.h | 4 ++-- test_conformance/images/common.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test_common/harness/testHarness.h b/test_common/harness/testHarness.h index 32ed18b4..cc9d8212 100644 --- a/test_common/harness/testHarness.h +++ b/test_common/harness/testHarness.h @@ -28,8 +28,8 @@ public: Version(): m_major(0), m_minor(0) {} Version(cl_uint major, cl_uint minor): m_major(major), m_minor(minor) {} - int major() const { return m_major; } - int minor() const { return m_minor; } + int get_major() const { return m_major; } + int get_minor() const { return m_minor; } bool operator>(const Version &rhs) const { return to_uint() > rhs.to_uint(); diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 95845b72..8120e3ab 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -248,7 +248,7 @@ clMemWrapper create_image(cl_context context, cl_command_queue queue, cl_mem_flags buffer_flags = CL_MEM_READ_WRITE; if (enable_pitch) { - if (version.major() == 1) + if (version.get_major() == 1) { host_ptr = malloc(imageInfo->rowPitch); }