From a47366b37858244c9ad134c22afc7d72ee02d5d2 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 25 Jan 2023 19:50:07 +0100 Subject: [PATCH] Clarify `#undef` behavior on non-existing defines in Shader preprocessor --- tutorials/shaders/shader_reference/shader_preprocessor.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tutorials/shaders/shader_reference/shader_preprocessor.rst b/tutorials/shaders/shader_reference/shader_preprocessor.rst index c4f6c1cb2..ea34eab2c 100644 --- a/tutorials/shaders/shader_reference/shader_preprocessor.rst +++ b/tutorials/shaders/shader_reference/shader_preprocessor.rst @@ -111,6 +111,10 @@ The ``#undef`` directive may be used to cancel a previously defined ``#define`` return MY_COLOR; } + // Like in most preprocessors, undefining a define that was not previously defined is allowed + // (and won't print any warning or error). + #undef THIS_DOES_NOT_EXIST + Without ``#undef`` in the above example, there would be a macro redefinition error. #if