Mercurial > gnulib
annotate lib/localeconv.c @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
16720 | 1 /* Query locale dependent information for formatting numbers. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16720
diff
changeset
|
2 Copyright (C) 2012-2013 Free Software Foundation, Inc. |
16720 | 3 |
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 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 General Public License for more details. | |
13 | |
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/>. */ | |
16 | |
17 #include <config.h> | |
18 | |
19 /* Specification. */ | |
20 #include <locale.h> | |
21 | |
22 #if HAVE_STRUCT_LCONV_DECIMAL_POINT | |
23 | |
24 /* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_* | |
25 members. */ | |
26 | |
27 struct lconv * | |
28 localeconv (void) | |
29 { | |
30 static struct lconv result; | |
31 # undef lconv | |
32 # undef localeconv | |
33 struct lconv *sys_result = localeconv (); | |
34 | |
35 result.decimal_point = sys_result->decimal_point; | |
36 result.thousands_sep = sys_result->thousands_sep; | |
37 result.grouping = sys_result->grouping; | |
38 result.mon_decimal_point = sys_result->mon_decimal_point; | |
39 result.mon_thousands_sep = sys_result->mon_thousands_sep; | |
40 result.mon_grouping = sys_result->mon_grouping; | |
41 result.positive_sign = sys_result->positive_sign; | |
42 result.negative_sign = sys_result->negative_sign; | |
43 result.currency_symbol = sys_result->currency_symbol; | |
44 result.frac_digits = sys_result->frac_digits; | |
45 result.p_cs_precedes = sys_result->p_cs_precedes; | |
46 result.p_sign_posn = sys_result->p_sign_posn; | |
47 result.p_sep_by_space = sys_result->p_sep_by_space; | |
48 result.n_cs_precedes = sys_result->n_cs_precedes; | |
49 result.n_sign_posn = sys_result->n_sign_posn; | |
50 result.n_sep_by_space = sys_result->n_sep_by_space; | |
51 result.int_curr_symbol = sys_result->int_curr_symbol; | |
52 result.int_frac_digits = sys_result->int_frac_digits; | |
53 result.int_p_cs_precedes = sys_result->p_cs_precedes; | |
54 result.int_p_sign_posn = sys_result->p_sign_posn; | |
55 result.int_p_sep_by_space = sys_result->p_sep_by_space; | |
56 result.int_n_cs_precedes = sys_result->n_cs_precedes; | |
57 result.int_n_sign_posn = sys_result->n_sign_posn; | |
58 result.int_n_sep_by_space = sys_result->n_sep_by_space; | |
59 | |
60 return &result; | |
61 } | |
62 | |
63 #else | |
64 | |
65 /* Override for platforms where 'struct lconv' is a dummy. */ | |
66 | |
67 # include <limits.h> | |
68 | |
69 struct lconv * | |
70 localeconv (void) | |
71 { | |
72 static /*const*/ struct lconv result = | |
73 { | |
74 /* decimal_point */ ".", | |
75 /* thousands_sep */ "", | |
76 /* grouping */ "", | |
77 /* mon_decimal_point */ "", | |
78 /* mon_thousands_sep */ "", | |
79 /* mon_grouping */ "", | |
80 /* positive_sign */ "", | |
81 /* negative_sign */ "", | |
82 /* currency_symbol */ "", | |
83 /* frac_digits */ CHAR_MAX, | |
84 /* p_cs_precedes */ CHAR_MAX, | |
85 /* p_sign_posn */ CHAR_MAX, | |
86 /* p_sep_by_space */ CHAR_MAX, | |
87 /* n_cs_precedes */ CHAR_MAX, | |
88 /* n_sign_posn */ CHAR_MAX, | |
89 /* n_sep_by_space */ CHAR_MAX, | |
90 /* int_curr_symbol */ "", | |
91 /* int_frac_digits */ CHAR_MAX, | |
92 /* int_p_cs_precedes */ CHAR_MAX, | |
93 /* int_p_sign_posn */ CHAR_MAX, | |
94 /* int_p_sep_by_space */ CHAR_MAX, | |
95 /* int_n_cs_precedes */ CHAR_MAX, | |
96 /* int_n_sign_posn */ CHAR_MAX, | |
97 /* int_n_sep_by_space */ CHAR_MAX | |
98 }; | |
99 | |
100 return &result; | |
101 } | |
102 | |
103 #endif |