1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-01 22:28:02 +02:00

common,w32: Avoid unused var warning about msgcache.

* common/i18n.c (USE_MSGCACHE): New.
(msgcache) [!USE_MSGCACHE]: Do not define.
(i18n_localegettext): Repalce #if conditions by USE_MSGCACHE.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-07-28 17:38:44 +02:00
parent 18f1e627c6
commit 4bc75337f3
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -38,8 +38,16 @@
#include "i18n.h" #include "i18n.h"
/* An object to store pointers to static strings and there static #undef USE_MSGCACHE
translation. A linked list is not optimal but given that we only #if defined(HAVE_SETLOCALE) && defined(LC_MESSAGES) \
&& !defined(USE_SIMPLE_GETTEXT) && defined(ENABLE_NLS)
# define USE_MSGCACHE 1
#endif
#ifdef USE_MSGCACHE
/* An object to store pointers to static strings and their static
translations. A linked list is not optimal but given that we only
have a few dozen messages it should be acceptable. */ have a few dozen messages it should be acceptable. */
struct msg_cache_s struct msg_cache_s
{ {
@ -67,6 +75,7 @@ struct msg_cache_heads_s
static strings. */ static strings. */
static struct msg_cache_heads_s *msgcache; static struct msg_cache_heads_s *msgcache;
#endif /*USE_MSGCACHE*/
void void
@ -153,8 +162,7 @@ i18n_utf8 (const char *string)
const char * const char *
i18n_localegettext (const char *lc_messages, const char *string) i18n_localegettext (const char *lc_messages, const char *string)
{ {
#if defined(HAVE_SETLOCALE) && defined(LC_MESSAGES) \ #if USE_MSGCACHE
&& !defined(USE_SIMPLE_GETTEXT) && defined(ENABLE_NLS)
const char *result = NULL; const char *result = NULL;
char *saved = NULL; char *saved = NULL;
struct msg_cache_heads_s *mh; struct msg_cache_heads_s *mh;
@ -220,8 +228,10 @@ i18n_localegettext (const char *lc_messages, const char *string)
xfree (saved); xfree (saved);
return result? result : _(string); return result? result : _(string);
#else /*!(HAVE_SETLOCALE && LC_MESSAGES ...)*/ #else /*!USE_MSGCACHE*/
(void)lc_messages; (void)lc_messages;
return _(string); return _(string);
#endif /*!(HAVE_SETLOCALE && LC_MESSAGES ...)*/
#endif /*!USE_MSGCACHE*/
} }