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
This commit is contained in:
Jose Lopez
2025-08-26 17:35:48 +01:00
committed by GitHub
parent c0f5c4e271
commit b0245f1a28
2 changed files with 3 additions and 3 deletions

View File

@@ -28,8 +28,8 @@ public:
Version(): m_major(0), m_minor(0) {} Version(): m_major(0), m_minor(0) {}
Version(cl_uint major, cl_uint minor): m_major(major), m_minor(minor) {} Version(cl_uint major, cl_uint minor): m_major(major), m_minor(minor) {}
int major() const { return m_major; } int get_major() const { return m_major; }
int minor() const { return m_minor; } int get_minor() const { return m_minor; }
bool operator>(const Version &rhs) const bool operator>(const Version &rhs) const
{ {
return to_uint() > rhs.to_uint(); return to_uint() > rhs.to_uint();

View File

@@ -248,7 +248,7 @@ clMemWrapper create_image(cl_context context, cl_command_queue queue,
cl_mem_flags buffer_flags = CL_MEM_READ_WRITE; cl_mem_flags buffer_flags = CL_MEM_READ_WRITE;
if (enable_pitch) if (enable_pitch)
{ {
if (version.major() == 1) if (version.get_major() == 1)
{ {
host_ptr = malloc(imageInfo->rowPitch); host_ptr = malloc(imageInfo->rowPitch);
} }