Mercurial > hg > CbC > CbC_gcc
comparison intl/libgnuintl.h @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
110 # define _INTL_STRINGIFY(prefix) #prefix | 110 # define _INTL_STRINGIFY(prefix) #prefix |
111 #else | 111 #else |
112 # define _INTL_ASM(cname) | 112 # define _INTL_ASM(cname) |
113 #endif | 113 #endif |
114 | 114 |
115 /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return | |
116 its n-th argument literally. This enables GCC to warn for example about | |
117 printf (gettext ("foo %y")). */ | |
118 #if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus) | |
119 # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) | |
120 #else | |
121 # define _INTL_MAY_RETURN_STRING_ARG(n) | |
122 #endif | |
123 | |
115 /* Look up MSGID in the current default message catalog for the current | 124 /* Look up MSGID in the current default message catalog for the current |
116 LC_MESSAGES locale. If not found, returns MSGID itself (the default | 125 LC_MESSAGES locale. If not found, returns MSGID itself (the default |
117 text). */ | 126 text). */ |
118 #ifdef _INTL_REDIRECT_INLINE | 127 #ifdef _INTL_REDIRECT_INLINE |
119 extern char *libintl_gettext (const char *__msgid); | 128 extern char *libintl_gettext (const char *__msgid) |
129 _INTL_MAY_RETURN_STRING_ARG (1); | |
120 static inline char *gettext (const char *__msgid) | 130 static inline char *gettext (const char *__msgid) |
121 { | 131 { |
122 return libintl_gettext (__msgid); | 132 return libintl_gettext (__msgid); |
123 } | 133 } |
124 #else | 134 #else |
125 #ifdef _INTL_REDIRECT_MACROS | 135 #ifdef _INTL_REDIRECT_MACROS |
126 # define gettext libintl_gettext | 136 # define gettext libintl_gettext |
127 #endif | 137 #endif |
128 extern char *gettext _INTL_PARAMS ((const char *__msgid)) | 138 extern char *gettext _INTL_PARAMS ((const char *__msgid)) |
129 _INTL_ASM (libintl_gettext); | 139 _INTL_ASM (libintl_gettext) |
140 _INTL_MAY_RETURN_STRING_ARG (1); | |
130 #endif | 141 #endif |
131 | 142 |
132 /* Look up MSGID in the DOMAINNAME message catalog for the current | 143 /* Look up MSGID in the DOMAINNAME message catalog for the current |
133 LC_MESSAGES locale. */ | 144 LC_MESSAGES locale. */ |
134 #ifdef _INTL_REDIRECT_INLINE | 145 #ifdef _INTL_REDIRECT_INLINE |
135 extern char *libintl_dgettext (const char *__domainname, const char *__msgid); | 146 extern char *libintl_dgettext (const char *__domainname, const char *__msgid) |
147 _INTL_MAY_RETURN_STRING_ARG (2); | |
136 static inline char *dgettext (const char *__domainname, const char *__msgid) | 148 static inline char *dgettext (const char *__domainname, const char *__msgid) |
137 { | 149 { |
138 return libintl_dgettext (__domainname, __msgid); | 150 return libintl_dgettext (__domainname, __msgid); |
139 } | 151 } |
140 #else | 152 #else |
141 #ifdef _INTL_REDIRECT_MACROS | 153 #ifdef _INTL_REDIRECT_MACROS |
142 # define dgettext libintl_dgettext | 154 # define dgettext libintl_dgettext |
143 #endif | 155 #endif |
144 extern char *dgettext _INTL_PARAMS ((const char *__domainname, | 156 extern char *dgettext _INTL_PARAMS ((const char *__domainname, |
145 const char *__msgid)) | 157 const char *__msgid)) |
146 _INTL_ASM (libintl_dgettext); | 158 _INTL_ASM (libintl_dgettext) |
159 _INTL_MAY_RETURN_STRING_ARG (2); | |
147 #endif | 160 #endif |
148 | 161 |
149 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY | 162 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY |
150 locale. */ | 163 locale. */ |
151 #ifdef _INTL_REDIRECT_INLINE | 164 #ifdef _INTL_REDIRECT_INLINE |
152 extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, | 165 extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, |
153 int __category); | 166 int __category) |
167 _INTL_MAY_RETURN_STRING_ARG (2); | |
154 static inline char *dcgettext (const char *__domainname, const char *__msgid, | 168 static inline char *dcgettext (const char *__domainname, const char *__msgid, |
155 int __category) | 169 int __category) |
156 { | 170 { |
157 return libintl_dcgettext (__domainname, __msgid, __category); | 171 return libintl_dcgettext (__domainname, __msgid, __category); |
158 } | 172 } |
161 # define dcgettext libintl_dcgettext | 175 # define dcgettext libintl_dcgettext |
162 #endif | 176 #endif |
163 extern char *dcgettext _INTL_PARAMS ((const char *__domainname, | 177 extern char *dcgettext _INTL_PARAMS ((const char *__domainname, |
164 const char *__msgid, | 178 const char *__msgid, |
165 int __category)) | 179 int __category)) |
166 _INTL_ASM (libintl_dcgettext); | 180 _INTL_ASM (libintl_dcgettext) |
181 _INTL_MAY_RETURN_STRING_ARG (2); | |
167 #endif | 182 #endif |
168 | 183 |
169 | 184 |
170 /* Similar to `gettext' but select the plural form corresponding to the | 185 /* Similar to `gettext' but select the plural form corresponding to the |
171 number N. */ | 186 number N. */ |
172 #ifdef _INTL_REDIRECT_INLINE | 187 #ifdef _INTL_REDIRECT_INLINE |
173 extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, | 188 extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, |
174 unsigned long int __n); | 189 unsigned long int __n) |
190 _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); | |
175 static inline char *ngettext (const char *__msgid1, const char *__msgid2, | 191 static inline char *ngettext (const char *__msgid1, const char *__msgid2, |
176 unsigned long int __n) | 192 unsigned long int __n) |
177 { | 193 { |
178 return libintl_ngettext (__msgid1, __msgid2, __n); | 194 return libintl_ngettext (__msgid1, __msgid2, __n); |
179 } | 195 } |
182 # define ngettext libintl_ngettext | 198 # define ngettext libintl_ngettext |
183 #endif | 199 #endif |
184 extern char *ngettext _INTL_PARAMS ((const char *__msgid1, | 200 extern char *ngettext _INTL_PARAMS ((const char *__msgid1, |
185 const char *__msgid2, | 201 const char *__msgid2, |
186 unsigned long int __n)) | 202 unsigned long int __n)) |
187 _INTL_ASM (libintl_ngettext); | 203 _INTL_ASM (libintl_ngettext) |
204 _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); | |
188 #endif | 205 #endif |
189 | 206 |
190 /* Similar to `dgettext' but select the plural form corresponding to the | 207 /* Similar to `dgettext' but select the plural form corresponding to the |
191 number N. */ | 208 number N. */ |
192 #ifdef _INTL_REDIRECT_INLINE | 209 #ifdef _INTL_REDIRECT_INLINE |
193 extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, | 210 extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, |
194 const char *__msgid2, unsigned long int __n); | 211 const char *__msgid2, unsigned long int __n) |
212 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); | |
195 static inline char *dngettext (const char *__domainname, const char *__msgid1, | 213 static inline char *dngettext (const char *__domainname, const char *__msgid1, |
196 const char *__msgid2, unsigned long int __n) | 214 const char *__msgid2, unsigned long int __n) |
197 { | 215 { |
198 return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); | 216 return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); |
199 } | 217 } |
203 #endif | 221 #endif |
204 extern char *dngettext _INTL_PARAMS ((const char *__domainname, | 222 extern char *dngettext _INTL_PARAMS ((const char *__domainname, |
205 const char *__msgid1, | 223 const char *__msgid1, |
206 const char *__msgid2, | 224 const char *__msgid2, |
207 unsigned long int __n)) | 225 unsigned long int __n)) |
208 _INTL_ASM (libintl_dngettext); | 226 _INTL_ASM (libintl_dngettext) |
227 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); | |
209 #endif | 228 #endif |
210 | 229 |
211 /* Similar to `dcgettext' but select the plural form corresponding to the | 230 /* Similar to `dcgettext' but select the plural form corresponding to the |
212 number N. */ | 231 number N. */ |
213 #ifdef _INTL_REDIRECT_INLINE | 232 #ifdef _INTL_REDIRECT_INLINE |
214 extern char *libintl_dcngettext (const char *__domainname, | 233 extern char *libintl_dcngettext (const char *__domainname, |
215 const char *__msgid1, const char *__msgid2, | 234 const char *__msgid1, const char *__msgid2, |
216 unsigned long int __n, int __category); | 235 unsigned long int __n, int __category) |
236 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); | |
217 static inline char *dcngettext (const char *__domainname, | 237 static inline char *dcngettext (const char *__domainname, |
218 const char *__msgid1, const char *__msgid2, | 238 const char *__msgid1, const char *__msgid2, |
219 unsigned long int __n, int __category) | 239 unsigned long int __n, int __category) |
220 { | 240 { |
221 return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); | 241 return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); |
227 extern char *dcngettext _INTL_PARAMS ((const char *__domainname, | 247 extern char *dcngettext _INTL_PARAMS ((const char *__domainname, |
228 const char *__msgid1, | 248 const char *__msgid1, |
229 const char *__msgid2, | 249 const char *__msgid2, |
230 unsigned long int __n, | 250 unsigned long int __n, |
231 int __category)) | 251 int __category)) |
232 _INTL_ASM (libintl_dcngettext); | 252 _INTL_ASM (libintl_dcngettext) |
253 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); | |
233 #endif | 254 #endif |
234 | 255 |
235 | 256 |
236 /* Set the current default message catalog to DOMAINNAME. | 257 /* Set the current default message catalog to DOMAINNAME. |
237 If DOMAINNAME is null, return the current default. | 258 If DOMAINNAME is null, return the current default. |