diff --git a/console/linphonec.c b/console/linphonec.c index c820de060..cdf06f474 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -65,15 +65,6 @@ #endif /*_WIN32_WCE*/ -#ifdef ENABLE_NLS -#include -#ifndef _ -#define _(String) gettext(String) -#endif -#else -#define _(something) (something) -#endif - #ifndef PACKAGE_DIR #define PACKAGE_DIR "" #endif @@ -714,16 +705,6 @@ linphonec_init(int argc, char **argv) default: break; } -#ifdef ENABLE_NLS - if (NULL == bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR)) - perror ("bindtextdomain failed"); -#ifndef __ARM__ - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); -#endif - textdomain (GETTEXT_PACKAGE); -#else - printf ("NLS disabled.\n"); -#endif linphonec_parse_cmdline(argc, argv); diff --git a/coreapi/private.h b/coreapi/private.h index aaf0f117a..4d366caa0 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -66,7 +66,20 @@ extern "C" { #endif #ifdef ENABLE_NLS + +#ifdef _MSC_VER +// prevent libintl.h from re-defining fprintf and vfprintf +#ifndef fprintf +#define fprintf fprintf +#endif +#ifndef vfprintf +#define vfprintf vfprintf +#endif +#define _GL_STDIO_H +#endif + #include + #ifndef _ #define _(String) dgettext(GETTEXT_PACKAGE,String) #endif diff --git a/gtk/linphone.h b/gtk/linphone.h index b4bbf02c2..992fdabc2 100644 --- a/gtk/linphone.h +++ b/gtk/linphone.h @@ -31,13 +31,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "ldap/ldapprovider.h" #ifdef ENABLE_NLS + +#ifdef _MSC_VER +// prevent libintl.h from re-defining fprintf and vfprintf +#ifndef fprintf +#define fprintf fprintf +#endif +#ifndef vfprintf +#define vfprintf vfprintf +#endif +#define _GL_STDIO_H +#endif + # include # undef _ # define _(String) dgettext (GETTEXT_PACKAGE,String) #else # define _(String) (String) # define ngettext(singular,plural,number) ((number>1) ? (plural) : (singular) ) -#endif +#endif // ENABLE_NLS #undef N_ #define N_(str) (str)