summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-11-12 11:46:56 -0500
committerSam Anthony <sam@samanthony.xyz>2024-11-12 11:46:56 -0500
commitd553ca9b4020534f3b44fad4ee23b53a8f5019df (patch)
tree0f3b8999c68419b0e2256a6cd77e40753380ec51
parent9c093f3e7c7334cb658e4c8908f9c96a0a67b82b (diff)
downloadballs-d553ca9b4020534f3b44fad4ee23b53a8f5019df.zip
fix contextProperties() macro
-rw-r--r--balls.c32
1 files 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"