From d553ca9b4020534f3b44fad4ee23b53a8f5019df Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 12 Nov 2024 11:46:56 -0500 Subject: fix contextProperties() macro --- balls.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/balls.c b/balls.c index 6c7d47c..4dca29e 100644 --- a/balls.c +++ b/balls.c @@ -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" -- cgit v1.2.3