Jogamp
Fix compilation of OpenCL 2.x headers on OS X
authorWade Walker <wwalker3@austin.rr.com>
Sun, 1 Nov 2015 20:13:37 +0000 (14:13 -0600)
committerWade Walker <wwalker3@austin.rr.com>
Sun, 8 Nov 2015 20:05:35 +0000 (14:05 -0600)
The include files were getting the OS X framework files from OpenCL/*.h,
instead of the local stub files from CL/*.h, which meant that OpenCL
2.x-related things were undefined. Changed OpenCL 2.x stub files to
refer to local .h files only. Maybe later change 1.x also, but leaving
it for now to minimize disruption to working code.

make/stub_includes/CL11/cl.h
make/stub_includes/CL12/cl.h
make/stub_includes/CL20/cl.h
make/stub_includes/CL20/cl_ext.h
make/stub_includes/CL20/cl_gl.h
make/stub_includes/CL20/cl_gl_ext.h
make/stub_includes/CL20/cl_platform.h
make/stub_includes/CL20/opencl.h

index 4355e74..51f86cd 100644 (file)
@@ -27,6 +27,7 @@
 #define __OPENCL_CL_H
 
 #ifdef __APPLE__
+#pragma GCC diagnostic ignored "-Wignored-attributes"
 #include <OpenCL/cl_platform.h>
 #else
 #include <CL/cl_platform.h>
index c2969b2..6ac4a5c 100644 (file)
@@ -25,6 +25,7 @@
 #define __OPENCL_CL_H
 
 #ifdef __APPLE__
+#pragma GCC diagnostic ignored "-Wignored-attributes"
 #include <OpenCL/cl_platform.h>
 #else
 #include <CL/cl_platform.h>
index 0105e57..caea06b 100644 (file)
@@ -25,7 +25,8 @@
 #define __OPENCL_CL_H
 
 #ifdef __APPLE__
-#include <OpenCL/cl_platform.h>
+#pragma GCC diagnostic ignored "-Wignored-attributes"
+#include <CL/cl_platform.h>
 #else
 #include <CL/cl_platform.h>
 #endif 
index cc15d85..5fb7349 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 
 #ifdef __APPLE__
-        #include <OpenCL/cl.h>
+    #include <CL/cl.h>
     #include <AvailabilityMacros.h>
 #else
         #include <CL/cl.h>
index 0408093..4ab6fb9 100644 (file)
@@ -25,7 +25,7 @@
 #define __OPENCL_CL_GL_H
 
 #ifdef __APPLE__
-#include <OpenCL/cl.h>
+#include <CL/cl.h>
 #else
 #include <CL/cl.h>
 #endif 
index a46e0a2..cac8a76 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 
 #ifdef __APPLE__
-    #include <OpenCL/cl_gl.h>
+    #include <CL/cl_gl.h>
 #else
     #include <CL/cl_gl.h>
 #endif
index cbde285..b18bbd6 100644 (file)
@@ -53,6 +53,11 @@ extern "C" {
     #define GCL_API_SUFFIX__VERSION_1_1                 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
     #define CL_EXT_SUFFIX__VERSION_1_1                  CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
     #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED       CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
+    /* OpenCL 2 unavailable on Mac as of 11/1/2015 */
+    #define CL_API_SUFFIX__VERSION_2_0
+    #define CL_EXT_SUFFIX__VERSION_2_0
+    #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
+    #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
     
     #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
         #define CL_API_SUFFIX__VERSION_1_2              AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
index 0c2e639..e8bfc0d 100644 (file)
@@ -32,10 +32,10 @@ extern "C" {
 
 #ifdef __APPLE__
 
-#include <OpenCL/cl.h>
-#include <OpenCL/cl_gl.h>
-#include <OpenCL/cl_gl_ext.h>
-#include <OpenCL/cl_ext.h>
+#include <CL/cl.h>
+#include <CL/cl_gl.h>
+#include <CL/cl_gl_ext.h>
+#include <CL/cl_ext.h>
 
 #else
 
http://JogAmp.org git info: FAQ, tutorial and man pages.