havelib: Support overriding the result of AC_LIB_PREPARE_MULTILIB.
[gnulib.git] / lib / langinfo.in.h
blob92cc73efadd381300d13d6a60620e6459570a862
1 /* Substitute for and wrapper around <langinfo.h>.
2 Copyright (C) 2009-2017 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>. */
18 * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
19 * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
22 #ifndef _@GUARD_PREFIX@_LANGINFO_H
24 #if __GNUC__ >= 3
25 @PRAGMA_SYSTEM_HEADER@
26 #endif
27 @PRAGMA_COLUMNS@
29 /* The include_next requires a split double-inclusion guard. */
30 #if @HAVE_LANGINFO_H@
31 # @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
32 #endif
34 #ifndef _@GUARD_PREFIX@_LANGINFO_H
35 #define _@GUARD_PREFIX@_LANGINFO_H
38 #if !@HAVE_LANGINFO_H@
40 /* A platform that lacks <langinfo.h>. */
42 /* Assume that it also lacks <nl_types.h> and the nl_item type. */
43 # if !GNULIB_defined_nl_item
44 typedef int nl_item;
45 # define GNULIB_defined_nl_item 1
46 # endif
48 /* nl_langinfo items of the LC_CTYPE category */
49 # define CODESET 10000
50 /* nl_langinfo items of the LC_NUMERIC category */
51 # define RADIXCHAR 10001
52 # define DECIMAL_POINT RADIXCHAR
53 # define THOUSEP 10002
54 # define THOUSANDS_SEP THOUSEP
55 # define GROUPING 10114
56 /* nl_langinfo items of the LC_TIME category */
57 # define D_T_FMT 10003
58 # define D_FMT 10004
59 # define T_FMT 10005
60 # define T_FMT_AMPM 10006
61 # define AM_STR 10007
62 # define PM_STR 10008
63 # define DAY_1 10009
64 # define DAY_2 (DAY_1 + 1)
65 # define DAY_3 (DAY_1 + 2)
66 # define DAY_4 (DAY_1 + 3)
67 # define DAY_5 (DAY_1 + 4)
68 # define DAY_6 (DAY_1 + 5)
69 # define DAY_7 (DAY_1 + 6)
70 # define ABDAY_1 10016
71 # define ABDAY_2 (ABDAY_1 + 1)
72 # define ABDAY_3 (ABDAY_1 + 2)
73 # define ABDAY_4 (ABDAY_1 + 3)
74 # define ABDAY_5 (ABDAY_1 + 4)
75 # define ABDAY_6 (ABDAY_1 + 5)
76 # define ABDAY_7 (ABDAY_1 + 6)
77 # define MON_1 10023
78 # define MON_2 (MON_1 + 1)
79 # define MON_3 (MON_1 + 2)
80 # define MON_4 (MON_1 + 3)
81 # define MON_5 (MON_1 + 4)
82 # define MON_6 (MON_1 + 5)
83 # define MON_7 (MON_1 + 6)
84 # define MON_8 (MON_1 + 7)
85 # define MON_9 (MON_1 + 8)
86 # define MON_10 (MON_1 + 9)
87 # define MON_11 (MON_1 + 10)
88 # define MON_12 (MON_1 + 11)
89 # define ABMON_1 10035
90 # define ABMON_2 (ABMON_1 + 1)
91 # define ABMON_3 (ABMON_1 + 2)
92 # define ABMON_4 (ABMON_1 + 3)
93 # define ABMON_5 (ABMON_1 + 4)
94 # define ABMON_6 (ABMON_1 + 5)
95 # define ABMON_7 (ABMON_1 + 6)
96 # define ABMON_8 (ABMON_1 + 7)
97 # define ABMON_9 (ABMON_1 + 8)
98 # define ABMON_10 (ABMON_1 + 9)
99 # define ABMON_11 (ABMON_1 + 10)
100 # define ABMON_12 (ABMON_1 + 11)
101 # define ERA 10047
102 # define ERA_D_FMT 10048
103 # define ERA_D_T_FMT 10049
104 # define ERA_T_FMT 10050
105 # define ALT_DIGITS 10051
106 /* nl_langinfo items of the LC_MONETARY category */
107 # define CRNCYSTR 10052
108 # define CURRENCY_SYMBOL CRNCYSTR
109 # define INT_CURR_SYMBOL 10100
110 # define MON_DECIMAL_POINT 10101
111 # define MON_THOUSANDS_SEP 10102
112 # define MON_GROUPING 10103
113 # define POSITIVE_SIGN 10104
114 # define NEGATIVE_SIGN 10105
115 # define FRAC_DIGITS 10106
116 # define INT_FRAC_DIGITS 10107
117 # define P_CS_PRECEDES 10108
118 # define N_CS_PRECEDES 10109
119 # define P_SEP_BY_SPACE 10110
120 # define N_SEP_BY_SPACE 10111
121 # define P_SIGN_POSN 10112
122 # define N_SIGN_POSN 10113
123 /* nl_langinfo items of the LC_MESSAGES category */
124 # define YESEXPR 10053
125 # define NOEXPR 10054
127 #else
129 /* A platform that has <langinfo.h>. */
131 # if !@HAVE_LANGINFO_CODESET@
132 # define CODESET 10000
133 # define GNULIB_defined_CODESET 1
134 # endif
136 # if !@HAVE_LANGINFO_T_FMT_AMPM@
137 # define T_FMT_AMPM 10006
138 # define GNULIB_defined_T_FMT_AMPM 1
139 # endif
141 # if !@HAVE_LANGINFO_ERA@
142 # define ERA 10047
143 # define ERA_D_FMT 10048
144 # define ERA_D_T_FMT 10049
145 # define ERA_T_FMT 10050
146 # define ALT_DIGITS 10051
147 # define GNULIB_defined_ERA 1
148 # endif
150 # if !@HAVE_LANGINFO_YESEXPR@
151 # define YESEXPR 10053
152 # define NOEXPR 10054
153 # define GNULIB_defined_YESEXPR 1
154 # endif
156 #endif
158 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
160 /* The definition of _GL_WARN_ON_USE is copied here. */
162 /* Declare overridden functions. */
165 /* Return a piece of locale dependent information.
166 Note: The difference between nl_langinfo (CODESET) and locale_charset ()
167 is that the latter normalizes the encoding names to GNU conventions. */
169 #if @GNULIB_NL_LANGINFO@
170 # if @REPLACE_NL_LANGINFO@
171 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
172 # undef nl_langinfo
173 # define nl_langinfo rpl_nl_langinfo
174 # endif
175 _GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
176 _GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
177 # else
178 # if !@HAVE_NL_LANGINFO@
179 _GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
180 # endif
181 _GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
182 # endif
183 _GL_CXXALIASWARN (nl_langinfo);
184 #elif defined GNULIB_POSIXCHECK
185 # undef nl_langinfo
186 # if HAVE_RAW_DECL_NL_LANGINFO
187 _GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
188 "use gnulib module nl_langinfo for portability");
189 # endif
190 #endif
193 #endif /* _@GUARD_PREFIX@_LANGINFO_H */
194 #endif /* _@GUARD_PREFIX@_LANGINFO_H */