From 68c54c226c2c0d61028f308c01bfce92c03a71c1 Mon Sep 17 00:00:00 2001 From: troky Date: Thu, 5 Jun 2014 10:19:27 +0200 Subject: [PATCH] Partially reverting e4a4efdb42 to keep MSVS compatibility. --- ocl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocl.c b/ocl.c index 911bd3c7..db879e89 100644 --- a/ocl.c +++ b/ocl.c @@ -619,9 +619,10 @@ build: size_t log_size; status = clGetProgramBuildInfo(clState->program, devices[gpu], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); - char sz_log[log_size]; + char *sz_log = (char *)malloc(log_size); status = clGetProgramBuildInfo(clState->program, devices[gpu], CL_PROGRAM_BUILD_LOG, log_size, sz_log, NULL); applog(LOG_ERR, "%s", sz_log); + free(sz_log); goto not_built; } @@ -755,9 +756,10 @@ built: size_t log_size; status = clGetProgramBuildInfo(clState->program, devices[gpu], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); - char sz_log[log_size]; + char *sz_log = (char *)malloc(log_size); status = clGetProgramBuildInfo(clState->program, devices[gpu], CL_PROGRAM_BUILD_LOG, log_size, sz_log, NULL); applog(LOG_ERR, "%s", sz_log); + free(sz_log); return NULL; } }