diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-12 11:46:56 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-12 11:46:56 -0500 |
| commit | d553ca9b4020534f3b44fad4ee23b53a8f5019df (patch) | |
| tree | 0f3b8999c68419b0e2256a6cd77e40753380ec51 | |
| parent | 9c093f3e7c7334cb658e4c8908f9c96a0a67b82b (diff) | |
| download | balls-d553ca9b4020534f3b44fad4ee23b53a8f5019df.zip | |
fix contextProperties() macro
| -rw-r--r-- | balls.c | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -15,23 +15,21 @@ #include "balls.h" #define nelem(arr) (sizeof(arr) / sizeof(arr[0])) -#define contextProperties(platform) ( - #ifdef WINDOWS - ({ - CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(), - CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC(), - CL_CONTEXT_PLATFORM, (cl_context_properties) (platform), - 0 - }) - #else - ({ - CL_GL_CONTEXT_KHR, (cl_context_properties) glXGetCurrentContext(), - CL_GLX_DISPLAY_KHR, (cl_context_properties) glXGetCurrentDisplay(), - CL_CONTEXT_PLATFORM, (cl_context_properties) (platform), - 0 - }) - #endif -) +#ifdef WINDOWS +#define contextProperties(platform) { \ + CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(), \ + CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC(), \ + CL_CONTEXT_PLATFORM, (cl_context_properties) (platform), \ + 0 \ +} +#else +#define contextProperties(platform) { \ + CL_GL_CONTEXT_KHR, (cl_context_properties) glXGetCurrentContext(), \ + CL_GLX_DISPLAY_KHR, (cl_context_properties) glXGetCurrentDisplay(), \ + CL_CONTEXT_PLATFORM, (cl_context_properties) (platform), \ + 0 \ +} +#endif #define PROG_FILE "balls.cl" #define MOVE_KERNEL_FUNC "move" |