@@ -43,6 +43,8 @@ static inline int gettext_width(const char *s)
#ifdef GETTEXT_POISON
extern int use_gettext_poison(void);
+
+#define GETTEXT_POISON_MAGIC "# GETTEXT POISON #"
#endif
static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
@@ -51,7 +53,7 @@ static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
return "";
#ifdef GETTEXT_POISON
if (use_gettext_poison())
- return "# GETTEXT POISON #";
+ return GETTEXT_POISON_MAGIC;
#endif
return gettext(msgid);
}
@@ -61,7 +63,7 @@ const char *Q_(const char *msgid, const char *plu, unsigned long n)
{
#ifdef GETTEXT_POISON
if (use_gettext_poison())
- return "# GETTEXT POISON #";
+ return GETTEXT_POISON_MAGIC;
#endif
return ngettext(msgid, plu, n);
}
The "# GETTEXT POISON #" string literal is currently used in two functions in 'gettext.h'. A later patch will add a function to 'gettext.c' using this string literal as well. Avoid this duplication and put that string literal into a macro which is only available in GETTEXT POISON builds. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> --- gettext.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)