OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 VMware, Inc. | 2 * Copyright 2010 VMware, Inc. |
3 * All Rights Reserved. | 3 * All Rights Reserved. |
4 * | 4 * |
5 * Permission is hereby granted, free of charge, to any person obtaining a | 5 * Permission is hereby granted, free of charge, to any person obtaining a |
6 * copy of this software and associated documentation files (the | 6 * copy of this software and associated documentation files (the |
7 * "Software"), to deal in the Software without restriction, including | 7 * "Software"), to deal in the Software without restriction, including |
8 * without limitation the rights to use, copy, modify, merge, publish, | 8 * without limitation the rights to use, copy, modify, merge, publish, |
9 * distribute, sub license, and/or sell copies of the Software, and to | 9 * distribute, sub license, and/or sell copies of the Software, and to |
10 * permit persons to whom the Software is furnished to do so, subject to | 10 * permit persons to whom the Software is furnished to do so, subject to |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 | 39 |
40 /** | 40 /** |
41 * Wrapper around strtod which uses the "C" locale so the decimal | 41 * Wrapper around strtod which uses the "C" locale so the decimal |
42 * point is always '.' | 42 * point is always '.' |
43 */ | 43 */ |
44 double | 44 double |
45 glsl_strtod(const char *s, char **end) | 45 glsl_strtod(const char *s, char **end) |
46 { | 46 { |
47 #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ | 47 #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ |
48 !defined(__HAIKU__) && !defined(__UCLIBC__) | 48 !defined(__HAIKU__) && !defined(__UCLIBC__) && !defined(ANDROID) |
49 static locale_t loc = NULL; | 49 static locale_t loc = NULL; |
50 if (!loc) { | 50 if (!loc) { |
51 loc = newlocale(LC_CTYPE_MASK, "C", NULL); | 51 loc = newlocale(LC_CTYPE_MASK, "C", NULL); |
52 } | 52 } |
53 return strtod_l(s, end, loc); | 53 return strtod_l(s, end, loc); |
54 #else | 54 #else |
55 return strtod(s, end); | 55 return strtod(s, end); |
56 #endif | 56 #endif |
57 } | 57 } |
OLD | NEW |