[packages] gettext: remove duplicate defines, thanks hlu
[openwrt/svn-archive/archive.git] / libs / gettext / src / include / libintl.h
1 /*
2 * This code is lifted from http://permalink.gmane.org/gmane.linux.gentoo.embedded/3218
3 */
4
5 #ifndef _LIBINTL_H
6 #define _LIBINTL_H 1
7
8 #include <features.h>
9 #include <locale.h>
10
11 #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_GETTEXT_AWARENESS__)
12
13 /* Undef gettext macros, if any... */
14 #undef gettext
15 #undef dgettext
16 #undef dcgettext
17 #undef ngettext
18 #undef dngettext
19 #undef dcngettext
20 #undef textdomain
21 #undef bindtextdomain
22 #undef bind_textdomain_codeset
23
24 /* part of locale.h */
25 /* #undef setlocale */
26
27 #undef _
28 #undef N_
29
30 /* Define gettext stubs that map back to the original strings */
31 #define gettext(String) (String)
32 #define dgettext(Domain, String) (String)
33 #define dcgettext(Domain, String, Type) (String)
34
35 #define ngettext(Singular, Plural, Count) \
36 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
37
38 #define dngettext(Domain, Singular, Plural, Count) \
39 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
40
41 #define dcngettext(Domain, Singular, Plural, Count, Category) \
42 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
43
44 #define _(String) (String)
45 #define N_(String) (String)
46
47 #ifndef _LOCALE_H
48 /* #define setlocale(Category, Locale) ((char *)NULL) */
49 #endif
50
51 /* No-ops for textdomain operations */
52 #define bindtextdomain(Domain, Directory) (Domain)
53 #define bind_textdomain_codeset(Domain, Codeset) (Codeset)
54 #define textdomain(String) (String) ?: "messages"
55
56 #endif /* GETTEXT */
57 #endif /* _LIBINTL_H */