diff --git a/src/wrapper/wrap_cl.hpp b/src/wrapper/wrap_cl.hpp
index 90c9a3f85c62337377d1d0c9938262979731c707..9efedf76b87d5aad5d65414849b786fc3d633eb3 100644
--- a/src/wrapper/wrap_cl.hpp
+++ b/src/wrapper/wrap_cl.hpp
@@ -3006,7 +3006,8 @@ namespace pyopencl
 
 
 
-#if PYOPENCL_CL_VERSION >= 0x1020
+#if (PYOPENCL_CL_VERSION >= 0x1020) && \
+      ((PYOPENCL_CL_VERSION >= 0x1030) && defined(__APPLE__))
   inline
   program *create_program_with_built_in_kernels(
       context &ctx,
@@ -3033,9 +3034,11 @@ namespace pyopencl
       throw;
     }
   }
+#endif
 
 
 
+#if PYOPENCL_CL_VERSION >= 0x1020
   inline
   program *link_program(
       context &ctx,
diff --git a/src/wrapper/wrap_cl_part_2.cpp b/src/wrapper/wrap_cl_part_2.cpp
index 3205c2e1f52938799a3fa3c48492c69e231da6dc..cc7942c8b6af64cdb5aaf9fe44419c46f3185ae1 100644
--- a/src/wrapper/wrap_cl_part_2.cpp
+++ b/src/wrapper/wrap_cl_part_2.cpp
@@ -196,7 +196,8 @@ void pyopencl_expose_part_2()
             create_program_with_binary,
             py::default_call_policies(),
             py::args("context", "devices", "binaries")))
-#if PYOPENCL_CL_VERSION >= 0x1020
+#if (PYOPENCL_CL_VERSION >= 0x1020) && \
+      ((PYOPENCL_CL_VERSION >= 0x1030) && defined(__APPLE__))
       .def("create_with_built_in_kernels",
           create_program_with_built_in_kernels,
           py::args("context", "devices", "kernel_names"),