37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
This fixes compilation on ppc with opencl on. Prevent opencl
|
|
headers from defining keywords as macros which would conflict
|
|
with C++ keywords as well as C99 keyword macro bool.
|
|
|
|
--- src/external/CL/cl_platform.h
|
|
+++ src/external/CL/cl_platform.h
|
|
@@ -275,14 +275,23 @@ typedef unsigned int cl_GLenum;
|
|
|
|
/* Define basic vector types */
|
|
#if defined( __VEC__ )
|
|
+ #ifndef __APPLE_ALTIVEC__
|
|
+ /* prevent gcc from defining the keywords as macros
|
|
+ * do not manually undef for c99 stdbool.h compat
|
|
+ */
|
|
+ #define __APPLE_ALTIVEC__ 1
|
|
+ #include <altivec.h>
|
|
+ #undef __APPLE_ALTIVEC__
|
|
+ #else
|
|
#include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
|
|
- typedef vector unsigned char __cl_uchar16;
|
|
- typedef vector signed char __cl_char16;
|
|
- typedef vector unsigned short __cl_ushort8;
|
|
- typedef vector signed short __cl_short8;
|
|
- typedef vector unsigned int __cl_uint4;
|
|
- typedef vector signed int __cl_int4;
|
|
- typedef vector float __cl_float4;
|
|
+ #endif
|
|
+ typedef __vector unsigned char __cl_uchar16;
|
|
+ typedef __vector signed char __cl_char16;
|
|
+ typedef __vector unsigned short __cl_ushort8;
|
|
+ typedef __vector signed short __cl_short8;
|
|
+ typedef __vector unsigned int __cl_uint4;
|
|
+ typedef __vector signed int __cl_int4;
|
|
+ typedef __vector float __cl_float4;
|
|
#define __CL_UCHAR16__ 1
|
|
#define __CL_CHAR16__ 1
|
|
#define __CL_USHORT8__ 1
|