diff options
author | Werner Koch <wk@gnupg.org> | 2015-06-30 22:28:41 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-06-30 22:28:41 +0200 |
commit | 232af382e563fcbe15589a3ccae7d6908a17c44d (patch) | |
tree | dae4d92d1224900f5a15643e192fc352326cfd2b /common/i18n.h | |
parent | agent: Use different translation func for Pinentry strings. (diff) | |
download | gnupg2-232af382e563fcbe15589a3ccae7d6908a17c44d.tar.xz gnupg2-232af382e563fcbe15589a3ccae7d6908a17c44d.zip |
Flag the L_() function with attribute format_arg.
* agent/agent.h (LunderscorePROTO): New.
* common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New.
* common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for
i18n_localegettext. Expand LunderscorePROTO.
* agent/genkey.c (check_passphrase_constraints): Use xtryasprintf
again to keep the old translations.
--
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'common/i18n.h')
-rw-r--r-- | common/i18n.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/common/i18n.h b/common/i18n.h index 8507b8f27..45710b2cc 100644 --- a/common/i18n.h +++ b/common/i18n.h @@ -38,14 +38,24 @@ # endif #endif /*!USE_SIMPLE_GETTEXT*/ +#ifndef GNUPG_GCC_ATTR_FORMAT_ARG +#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */ +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a))) +#else +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) +#endif +#endif + void i18n_init (void); char *i18n_switchto_utf8 (void); void i18n_switchback (char *saved_codeset); const char *i18n_utf8 (const char *string); -const char *i18n_localegettext (const char *lc_messages, const char *string); +const char *i18n_localegettext (const char *lc_messages, const char *string) + GNUPG_GCC_ATTR_FORMAT_ARG(2); /* If a module wants a local L_() fucntion we define it here. */ #ifdef LunderscoreIMPL +LunderscorePROTO LunderscoreIMPL #endif |