summaryrefslogtreecommitdiffstats
path: root/package/libs/gettext/src/include/libintl.h
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-10 17:57:59 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-10 17:57:59 +0000
commit8237afec8bc17f52226dfe5f898b8a296a546a99 (patch)
tree02a53e99087587a92567963d44ff4fc60d4c6809 /package/libs/gettext/src/include/libintl.h
parent31330f91d6e694542981f34cfefab975cf785d5b (diff)
gettext: move to trunk and add myself as maintainer
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33712 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/libs/gettext/src/include/libintl.h')
-rw-r--r--package/libs/gettext/src/include/libintl.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/libs/gettext/src/include/libintl.h b/package/libs/gettext/src/include/libintl.h
new file mode 100644
index 000000000..a1157a445
--- /dev/null
+++ b/package/libs/gettext/src/include/libintl.h
@@ -0,0 +1,53 @@
+/*
+ * This code is lifted from http://permalink.gmane.org/gmane.linux.gentoo.embedded/3218
+ */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include <locale.h>
+
+/* Undef gettext macros, if any... */
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef ngettext
+#undef dngettext
+#undef dcngettext
+#undef textdomain
+#undef bindtextdomain
+#undef bind_textdomain_codeset
+
+/* part of locale.h */
+/* #undef setlocale */
+
+#undef _
+#undef N_
+
+/* Define gettext stubs that map back to the original strings */
+#define gettext(String) (String)
+#define dgettext(Domain, String) (String)
+#define dcgettext(Domain, String, Type) (String)
+
+#define ngettext(Singular, Plural, Count) \
+ ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
+
+#define dngettext(Domain, Singular, Plural, Count) \
+ ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
+
+#define dcngettext(Domain, Singular, Plural, Count, Category) \
+ ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
+
+#define _(String) (String)
+#define N_(String) String
+
+#ifndef _LOCALE_H
+/* #define setlocale(Category, Locale) ((char *)NULL) */
+#endif
+
+/* No-ops for textdomain operations */
+#define bindtextdomain(Domain, Directory) (Domain)
+#define bind_textdomain_codeset(Domain, Codeset) (Codeset)
+#define textdomain(String) (String) ?: "messages"
+
+#endif /* _LIBINTL_H */