# HG changeset patch # User Mike Ruprecht # Date 1544328110 21600 # Node ID 47667f5c6696f85389ecdc12b6d346c893876d59 # Parent 43e3da39daf6a7b04fb0bcb1cf3a4ff46bdc92a4 libpurple: Include 'glib/gi18n-lib.h' instead of 'libintl.h' This patch replaces includes of 'libintl.h' with 'glib/gi18n-lib.h'. The latter defines the macros we use, so we can remove our manual fallbacks. It also removes 'locale.h' from 'internal.h' as it's included only where needed now. Lastly, it defines GETTEXT_PACKAGE to be the same as the PACKAGE define. 'glib/gi18n-lib.h' uses this for its i18n macros. diff -r 43e3da39daf6 -r 47667f5c6696 libpurple/internal.h --- a/libpurple/internal.h Sat Dec 08 21:59:14 2018 -0600 +++ b/libpurple/internal.h Sat Dec 08 22:01:50 2018 -0600 @@ -36,36 +36,8 @@ #ifdef SKYOS #include #endif -/* - * If we're using NLS, make sure gettext works. If not, then define - * dummy macros in place of the normal gettext macros. - * - * Also, the perl XS config.h file sometimes defines _ So we need to - * make sure _ isn't already defined before trying to define it. - * - * The Singular/Plural/Number ngettext dummy definition below was - * taken from an email to the texinfo mailing list by Manuel Guerrero. - * Thank you Manuel, and thank you Alex's good friend Google. - */ -#ifdef ENABLE_NLS -# include -# include -# undef printf -# define _(String) ((const char *)dgettext(PACKAGE, String)) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# include -# define N_(String) (String) -# ifndef _ -# define _(String) ((const char *)String) -# endif -# define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) -# define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) -#endif + +#include #ifdef HAVE_ENDIAN_H # include diff -r 43e3da39daf6 -r 47667f5c6696 libpurple/win32/libc_interface.c --- a/libpurple/win32/libc_interface.c Sat Dec 08 21:59:14 2018 -0600 +++ b/libpurple/win32/libc_interface.c Sat Dec 08 22:01:50 2018 -0600 @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -37,26 +38,6 @@ #include #include "util.h" -/** This is redefined here because we can't include internal.h */ -#ifdef ENABLE_NLS -# include -# include -# define _(String) ((const char *)dgettext(PACKAGE, String)) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# include -# define N_(String) (String) -# ifndef _ -# define _(String) ((const char *)String) -# endif -# define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) -# define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) -#endif - #ifndef S_ISDIR # define S_ISDIR(m) (((m)&S_IFDIR)==S_IFDIR) #endif diff -r 43e3da39daf6 -r 47667f5c6696 meson.build --- a/meson.build Sat Dec 08 21:59:14 2018 -0600 +++ b/meson.build Sat Dec 08 22:01:50 2018 -0600 @@ -37,6 +37,7 @@ purple_h_conf = configuration_data() version_conf = configuration_data() +conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('VERSION', purple_display_version)