[Bf-blender-cvs] [05da8132d8f] master: BLT: include a non-executing reference to context in macros

Campbell Barton noreply at git.blender.org
Thu May 7 01:01:31 CEST 2020


Commit: 05da8132d8f721fe550bfd0d6553f8bb8d45760f
Author: Campbell Barton
Date:   Thu May 7 08:58:41 2020 +1000
Branches: master
https://developer.blender.org/rB05da8132d8f721fe550bfd0d6553f8bb8d45760f

BLT: include a non-executing reference to context in macros

Prevent errors when building without translations.

===================================================================

M	source/blender/blentranslation/BLT_translation.h
M	source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h
index 5f6ae0a86e9..817b99e8b91 100644
--- a/source/blender/blentranslation/BLT_translation.h
+++ b/source/blender/blentranslation/BLT_translation.h
@@ -65,9 +65,9 @@ bool BLT_lang_is_ime_supported(void);
 #  define IFACE_(msgid) msgid
 #  define TIP_(msgid) msgid
 #  define DATA_(msgid) msgid
-#  define CTX_IFACE_(context, msgid) msgid
-#  define CTX_TIP_(context, msgid) msgid
-#  define CTX_DATA_(context, msgid) msgid
+#  define CTX_IFACE_(context, msgid) ((void)(0 ? (context) : 0), msgid)
+#  define CTX_TIP_(context, msgid) ((void)(0 ? (context) : 0), msgid)
+#  define CTX_DATA_(context, msgid) ((void)(0 ? (context) : 0), msgid)
 #endif
 
 /* Helper macro, when we want to define a same msgid for multiple msgctxt...
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index f61344df7f5..088179520d7 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -697,6 +697,8 @@ static const char *template_id_context(StructRNA *type)
   }
   return BLT_I18NCONTEXT_DEFAULT;
 }
+#else
+#  define template_id_context(type) 0
 #endif
 
 static uiBut *template_id_def_new_but(uiBlock *block,



More information about the Bf-blender-cvs mailing list