[packages] add gettext dummy library
[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
10 #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_GETTEXT_AWARENESS__)
11
12 /* Undef gettext macros, if any... */
13 #undef gettext
14 #undef dgettext
15 #undef dcgettext
16 #undef ngettext
17 #undef dngettext
18 #undef dcngettext
19 #undef textdomain
20 #undef bindtextdomain
21 #undef bind_textdomain_codeset
22
23 /* part of locale.h */
24 /* #undef setlocale */
25
26 #undef _
27 #undef N_
28
29 /* Define gettext stubs that map back to the original strings */
30 #define gettext(String) (String)
31 #define dgettext(Domain, String) (String)
32 #define dcgettext(Domain, String, Type) (String)
33 #define dgettext(Domain, String) (String)
34 #define dcgettext(Domain, String, Type) (String)
35
36 #define ngettext(Singular, Plural, Count) \
37 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
38
39 #define dngettext(Domain, Singular, Plural, Count) \
40 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
41
42 #define dcngettext(Domain, Singular, Plural, Count, Category) \
43 ((Count) == 1 ? (const char *) (Singular) : (const char *) (Plural))
44
45 #define _(String) (String)
46 #define N_(String) (String)
47
48 #ifndef _LOCALE_H
49 /* #define setlocale(Category, Locale) ((char *)NULL) */
50 #endif
51
52 /* No-ops for textdomain operations */
53 #define bindtextdomain(Domain, Directory) (Domain)
54 #define bind_textdomain_codeset(Domain, Codeset) (Codeset)
55 #define textdomain(String) (String) ?: "messages"
56
57 #endif /* GETTEXT */
58 #endif /* _LIBINTL_H */