diff --git a/src/c_wrapper/clinfo_ext.h b/src/c_wrapper/clinfo_ext.h index 6094c52c18057b81e09526f3576c11042163e942..9263981e743a947b895cfd1344f2432cbebdbbd6 100644 --- a/src/c_wrapper/clinfo_ext.h +++ b/src/c_wrapper/clinfo_ext.h @@ -4,7 +4,7 @@ #ifndef _EXT_H #define _EXT_H -#ifdef __APPLE__ +#if (defined(__APPLE__) && !defined(PYOPENCL_APPLE_USE_CL_H)) #include #else #include diff --git a/src/c_wrapper/context.cpp b/src/c_wrapper/context.cpp index 0a453d0ba797d396e1cdd2cd2ede6195f3d498e6..f2478fd73a54c11dbed830f6eace3e57f9ace215 100644 --- a/src/c_wrapper/context.cpp +++ b/src/c_wrapper/context.cpp @@ -68,7 +68,7 @@ context::get_info(cl_uint param_name) const break; #if defined(PYOPENCL_GL_SHARING_VERSION) && (PYOPENCL_GL_SHARING_VERSION >= 1) -#if defined(__APPLE__) && defined(HAVE_GL) +#if defined(__APPLE__) && defined(HAVE_GL) && !defined(PYOPENCL_APPLE_USE_CL_H) case CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE: #else case CL_GL_CONTEXT_KHR: diff --git a/src/c_wrapper/gl_obj.cpp b/src/c_wrapper/gl_obj.cpp index 6dfbec8c5ea11b78072964fb088d83849aa04763..bd7edf31d8ce772adae21047ab34e3eb925f1482 100644 --- a/src/c_wrapper/gl_obj.cpp +++ b/src/c_wrapper/gl_obj.cpp @@ -137,7 +137,7 @@ have_gl() cl_context_properties get_apple_cgl_share_group() { -#ifdef __APPLE__ +#if (defined(__APPLE__) && !defined(PYOPENCL_APPLE_USE_CL_H)) #ifdef HAVE_GL CGLContextObj kCGLContext = CGLGetCurrentContext(); CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kCGLContext); diff --git a/src/c_wrapper/pyopencl_ext.h b/src/c_wrapper/pyopencl_ext.h index 4b5e7871e57d7c26a89830e5bc5bec4bb1c8667c..cd5d7112ea6325d1770f2fbf4431c33ef2edec0d 100644 --- a/src/c_wrapper/pyopencl_ext.h +++ b/src/c_wrapper/pyopencl_ext.h @@ -7,7 +7,7 @@ #else -#ifdef __APPLE__ +#if (defined(__APPLE__) && !defined(PYOPENCL_APPLE_USE_CL_H)) #include diff --git a/src/c_wrapper/wrap_cl.h b/src/c_wrapper/wrap_cl.h index b097d12d9ebb32c092333721eef32ea847ba8ac5..21ff9c086805056e701186adf00070ed1eee48ed 100644 --- a/src/c_wrapper/wrap_cl.h +++ b/src/c_wrapper/wrap_cl.h @@ -13,7 +13,7 @@ #define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#ifdef __APPLE__ +#if (defined(__APPLE__) && !defined(PYOPENCL_APPLE_USE_CL_H)) // {{{ Mac diff --git a/src/c_wrapper/wrap_constants.cpp b/src/c_wrapper/wrap_constants.cpp index 701638b98b9eb415bd7da4cfe50ea45707d23b90..16b1d1f49ba156f10c5b19b63e36f9915b00b77d 100644 --- a/src/c_wrapper/wrap_constants.cpp +++ b/src/c_wrapper/wrap_constants.cpp @@ -421,7 +421,7 @@ void populate_constants(void(*add)(const char*, const char*, int64_t value)) ADD_ATTR("context_properties", ,WGL_HDC_KHR); ADD_ATTR("context_properties", ,CGL_SHAREGROUP_KHR); #endif -#if defined(__APPLE__) && defined(HAVE_GL) +#if defined(__APPLE__) && defined(HAVE_GL) && !defined(PYOPENCL_APPLE_USE_CL_H) ADD_ATTR("context_properties", ,CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE); #endif /* __APPLE__ */ #ifdef CL_CONTEXT_OFFLINE_DEVICES_AMD