aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-25 04:15:38 +0100
committerMax Kellermann <max@duempel.org>2008-12-25 04:15:38 +0100
commit634bed2e83799f604a60bfef62d5e240ea02511c (patch)
treea996a63ad0cc9f7c500492275b65971842479d40 /src
parent0abf816f752baef7299f32d21406e92d49d834c0 (diff)
downloadmpd-634bed2e83799f604a60bfef62d5e240ea02511c.tar.gz
mpd-634bed2e83799f604a60bfef62d5e240ea02511c.tar.xz
mpd-634bed2e83799f604a60bfef62d5e240ea02511c.zip
i18n: don't use locale.h
Just for the _() and N_() macros, we don't need to include locale.h - define them in i18n.h.
Diffstat (limited to 'src')
-rw-r--r--src/i18n.h15
-rw-r--r--src/main.c4
2 files changed, 14 insertions, 5 deletions
diff --git a/src/i18n.h b/src/i18n.h
index 64484834a..dd0ae85ae 100644
--- a/src/i18n.h
+++ b/src/i18n.h
@@ -21,13 +21,18 @@
#include "config.h"
-/* i18n */
-#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
-#include <locale.h>
-#endif
#ifdef ENABLE_NLS
+
#include <libintl.h>
-#include <glib/gi18n.h>
+
+#define _(x) gettext(x)
+
+#ifdef gettext_noop
+#define N_(x) gettext_noop(x)
+#else
+#define N_(x) (x)
+#endif
+
#else
#define _(x) x
#define N_(x) x
diff --git a/src/main.c b/src/main.c
index 67901371e..53ea8c592 100644
--- a/src/main.c
+++ b/src/main.c
@@ -45,6 +45,10 @@
#include <signal.h>
#include <string.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
/* time between mpd updates [s] */
static const guint update_interval = 500;