summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0abf816)
raw | patch | inline | side by side (parent: 0abf816)
author | Max Kellermann <max@duempel.org> | |
Thu, 25 Dec 2008 03:15:38 +0000 (04:15 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 25 Dec 2008 03:15:38 +0000 (04:15 +0100) |
Just for the _() and N_() macros, we don't need to include locale.h -
define them in i18n.h.
define them in i18n.h.
src/i18n.h | patch | blob | history | |
src/main.c | patch | blob | history |
diff --git a/src/i18n.h b/src/i18n.h
index 64484834a67847a4adc27d7861e2815f6e4f9241..dd0ae85aea74bb78acad5220e59ca194085d601c 100644 (file)
--- a/src/i18n.h
+++ b/src/i18n.h
#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 67901371e7e1c721fe798c0612fc40f5e507a25a..53ea8c5920d7c6e3452a1194492a6ab7355af151 100644 (file)
--- a/src/main.c
+++ b/src/main.c
#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;