From c5a4bbeabb10d8ed3d1c651b93aa31737bc473dd Mon Sep 17 00:00:00 2001 From: Nuno Fachada Date: Thu, 2 May 2019 19:03:46 +0100 Subject: [PATCH] Fix _cl_image_desc for OpenCL 1.2 compatibility --- CL/cl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CL/cl.h b/CL/cl.h index 3521676d..32ae73fc 100644 --- a/CL/cl.h +++ b/CL/cl.h @@ -137,19 +137,23 @@ typedef struct _cl_image_desc { size_t image_slice_pitch; cl_uint num_mip_levels; cl_uint num_samples; +#ifdef CL_VERSION_2_0 #ifdef __GNUC__ __extension__ /* Prevents warnings about anonymous union in -pedantic builds */ #endif #ifdef _MSC_VER -#pragma warning( push ) +#pragma warning( push ) #pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 /Za builds */ #endif union { +#endif cl_mem buffer; +#ifdef CL_VERSION_2_0 cl_mem mem_object; }; #ifdef _MSC_VER -#pragma warning( pop ) +#pragma warning( pop ) +#endif #endif } cl_image_desc;