[Bf-blender-cvs] [8351760ed08] master: Cycles: Remove Compilation Warning
Jeroen Bakker
noreply at git.blender.org
Mon Nov 23 16:36:48 CET 2020
Commit: 8351760ed0816cf5e4ca9fb0f08be717f733d34a
Author: Jeroen Bakker
Date: Mon Nov 23 16:36:00 2020 +0100
Branches: master
https://developer.blender.org/rB8351760ed0816cf5e4ca9fb0f08be717f733d34a
Cycles: Remove Compilation Warning
ROCm 3.9 already defined `NULL`. This patch will first check if it was
already defined to remove compilation warnings.
NOTE: This doesn't add official support for ROCm as it still fails to
render correctly (crashes with default cube).
Reviewed By: Brecht van Lommel
Differential Revision: https://developer.blender.org/D9610
===================================================================
M intern/cycles/kernel/kernel_compat_opencl.h
===================================================================
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 1848f6059b6..4a9304a134c 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -162,7 +162,9 @@
#define kernel_tex_fetch(tex, index) kernel_tex_array(tex)[(index)]
/* define NULL */
-#define NULL 0
+#ifndef NULL
+# define NULL ((void *)0)
+#endif
/* enable extensions */
#ifdef __KERNEL_CL_KHR_FP16__
More information about the Bf-blender-cvs
mailing list