Commit | Line | Data |
---|---|---|
414e4441 | 1 | /* A POSIX <locale.h>. |
f0007cad | 2 | Copyright (C) 2007-2012 Free Software Foundation, Inc. |
414e4441 LC |
3 | |
4 | This program is free software: you can redistribute it and/or modify | |
5 | it under the terms of the GNU Lesser General Public License as published by | |
6 | the Free Software Foundation; either version 3 of the License, or | |
7 | (at your option) any later version. | |
8 | ||
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 Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public License | |
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
16 | ||
3d458a81 | 17 | #ifndef _@GUARD_PREFIX@_LOCALE_H |
414e4441 LC |
18 | |
19 | #if __GNUC__ >= 3 | |
20 | @PRAGMA_SYSTEM_HEADER@ | |
21 | #endif | |
0f00f2c3 | 22 | @PRAGMA_COLUMNS@ |
414e4441 LC |
23 | |
24 | /* The include_next requires a split double-inclusion guard. */ | |
25 | #@INCLUDE_NEXT@ @NEXT_LOCALE_H@ | |
26 | ||
3d458a81 AW |
27 | #ifndef _@GUARD_PREFIX@_LOCALE_H |
28 | #define _@GUARD_PREFIX@_LOCALE_H | |
414e4441 LC |
29 | |
30 | /* NetBSD 5.0 mis-defines NULL. */ | |
31 | #include <stddef.h> | |
32 | ||
33 | /* MacOS X 10.5 defines the locale_t type in <xlocale.h>. */ | |
34 | #if @HAVE_XLOCALE_H@ | |
35 | # include <xlocale.h> | |
36 | #endif | |
37 | ||
f4c79b3c LC |
38 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
39 | ||
1cd4fffc LC |
40 | /* The definition of _GL_ARG_NONNULL is copied here. */ |
41 | ||
61cd9dc9 LC |
42 | /* The definition of _GL_WARN_ON_USE is copied here. */ |
43 | ||
414e4441 LC |
44 | /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. |
45 | On systems that don't define it, use the same value as GNU libintl. */ | |
46 | #if !defined LC_MESSAGES | |
47 | # define LC_MESSAGES 1729 | |
48 | #endif | |
49 | ||
49114fd4 LC |
50 | #if @GNULIB_SETLOCALE@ |
51 | # if @REPLACE_SETLOCALE@ | |
52 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
53 | # undef setlocale | |
54 | # define setlocale rpl_setlocale | |
55 | # define GNULIB_defined_setlocale 1 | |
56 | # endif | |
57 | _GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale)); | |
58 | _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale)); | |
59 | # else | |
60 | _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale)); | |
61 | # endif | |
62 | _GL_CXXALIASWARN (setlocale); | |
63 | #elif defined GNULIB_POSIXCHECK | |
64 | # undef setlocale | |
65 | # if HAVE_RAW_DECL_SETLOCALE | |
66 | _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " | |
67 | "use gnulib module setlocale for portability"); | |
68 | # endif | |
69 | #endif | |
70 | ||
414e4441 LC |
71 | #if @GNULIB_DUPLOCALE@ |
72 | # if @REPLACE_DUPLOCALE@ | |
f4c79b3c LC |
73 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
74 | # undef duplocale | |
75 | # define duplocale rpl_duplocale | |
76 | # endif | |
77 | _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1))); | |
78 | _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale)); | |
79 | # else | |
80 | # if @HAVE_DUPLOCALE@ | |
81 | _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale)); | |
82 | # endif | |
414e4441 | 83 | # endif |
a927b6c1 | 84 | # if @HAVE_DUPLOCALE@ |
f4c79b3c | 85 | _GL_CXXALIASWARN (duplocale); |
a927b6c1 | 86 | # endif |
414e4441 LC |
87 | #elif defined GNULIB_POSIXCHECK |
88 | # undef duplocale | |
61cd9dc9 LC |
89 | # if HAVE_RAW_DECL_DUPLOCALE |
90 | _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - " | |
91 | "use gnulib module duplocale for portability"); | |
92 | # endif | |
414e4441 LC |
93 | #endif |
94 | ||
3d458a81 AW |
95 | #endif /* _@GUARD_PREFIX@_LOCALE_H */ |
96 | #endif /* _@GUARD_PREFIX@_LOCALE_H */ |