mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
refactor: use fmt (#2758)
* deps: use fmt (8.1.1 tag) to build log strings Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
This commit is contained in:
@@ -36,7 +36,7 @@ struct tr_error;
|
||||
char const* tr_strip_positional_args(char const* fmt);
|
||||
|
||||
#if !defined(_)
|
||||
#if defined(HAVE_LIBINTL_H) && !defined(__APPLE__)
|
||||
#if defined(HAVE_GETTEXT) && !defined(__APPLE__)
|
||||
#include <libintl.h>
|
||||
#define _(a) gettext(a)
|
||||
#else
|
||||
@@ -44,6 +44,15 @@ char const* tr_strip_positional_args(char const* fmt);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(ngettext_)
|
||||
#if defined(HAVE_NGETTEXT) && !defined(__APPLE__)
|
||||
#include <libintl.h>
|
||||
#define ngettext_(singular, plural, count) ngettext(singular, plural, count)
|
||||
#else
|
||||
#define ngettext_(singular, plural, count) ((count) == 1 ? (singular) : (plural))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* #define DISABLE_GETTEXT */
|
||||
#ifndef DISABLE_GETTEXT
|
||||
#if defined(_WIN32) || defined(TR_LIGHTWEIGHT)
|
||||
@@ -52,7 +61,9 @@ char const* tr_strip_positional_args(char const* fmt);
|
||||
#endif
|
||||
#ifdef DISABLE_GETTEXT
|
||||
#undef _
|
||||
#undef ngettext_
|
||||
#define _(a) tr_strip_positional_args(a)
|
||||
#define ngettext_(singular, plural, count) tr_strip_positional_args((count) == 1 ? (singular) : (plural))
|
||||
#endif
|
||||
|
||||
/****
|
||||
|
||||
Reference in New Issue
Block a user