Mercurial > gnulib
annotate lib/wctype-impl.h @ 40231:9b3c79fdfe0b
strtod: fix clash with strtold
Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
* lib/strtod.c (compute_minus_zero, minus_zero):
Simplify by remving the macro / external variable,
and having just a function. User changed. This avoids
the need for an external variable that might clash.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 11 Mar 2019 16:40:29 -0700 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
14319 | 1 /* Get descriptor for a wide character property. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2011-2019 Free Software Foundation, Inc. |
14319 | 3 Written by Bruno Haible <bruno@clisp.org>, 2011. |
4 | |
5 This program is free software: you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 3 of the License, or | |
8 (at your option) any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
14319 | 17 |
18 wctype_t | |
19 wctype (const char* name) | |
20 { | |
21 switch (name[0]) | |
22 { | |
23 case 'a': | |
24 switch (name[1]) | |
25 { | |
26 case 'l': | |
27 switch (name[2]) | |
28 { | |
29 case 'n': | |
30 if (strcmp (name + 3, "um") == 0) | |
31 return (wctype_t) iswalnum; | |
32 break; | |
33 case 'p': | |
34 if (strcmp (name + 3, "ha") == 0) | |
35 return (wctype_t) iswalpha; | |
36 break; | |
37 default: | |
38 break; | |
39 } | |
40 break; | |
41 default: | |
42 break; | |
43 } | |
44 break; | |
45 case 'b': | |
46 if (strcmp (name + 1, "lank") == 0) | |
47 return (wctype_t) iswblank; | |
48 break; | |
49 case 'c': | |
50 if (strcmp (name + 1, "ntrl") == 0) | |
51 return (wctype_t) iswcntrl; | |
52 break; | |
53 case 'd': | |
54 if (strcmp (name + 1, "igit") == 0) | |
55 return (wctype_t) iswdigit; | |
56 break; | |
57 case 'g': | |
58 if (strcmp (name + 1, "raph") == 0) | |
59 return (wctype_t) iswgraph; | |
60 break; | |
61 case 'l': | |
62 if (strcmp (name + 1, "ower") == 0) | |
63 return (wctype_t) iswlower; | |
64 break; | |
65 case 'p': | |
66 switch (name[1]) | |
67 { | |
68 case 'r': | |
69 if (strcmp (name + 2, "int") == 0) | |
70 return (wctype_t) iswprint; | |
71 break; | |
72 case 'u': | |
73 if (strcmp (name + 2, "nct") == 0) | |
74 return (wctype_t) iswpunct; | |
75 break; | |
76 default: | |
77 break; | |
78 } | |
79 break; | |
80 case 's': | |
81 if (strcmp (name + 1, "pace") == 0) | |
82 return (wctype_t) iswspace; | |
83 break; | |
84 case 'u': | |
85 if (strcmp (name + 1, "pper") == 0) | |
86 return (wctype_t) iswupper; | |
87 break; | |
88 case 'x': | |
89 if (strcmp (name + 1, "digit") == 0) | |
90 return (wctype_t) iswxdigit; | |
91 break; | |
92 default: | |
93 break; | |
94 } | |
95 return NULL; | |
96 } |