File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 41
41
#include < cstdio>
42
42
#include < cstdlib>
43
43
#include < cstring>
44
- #if defined(__CYGWIN__) || defined(_WIN32) || defined(__HAIKU__) || defined(__OpenBSD__)
44
+ #if defined(__CYGWIN__) || defined(_WIN32) || defined(__HAIKU__)
45
45
#include < sstream>
46
46
#include < cmath>
47
+ #elif defined(__OpenBSD__)
48
+ #include < locale.h>
49
+
50
+ static double swift_strtod_l (const char *nptr, char **endptr, locale_t loc) {
51
+ return strtod (nptr, endptr);
52
+ }
53
+
54
+ static float swift_strtof_l (const char *nptr, char **endptr, locale_t loc) {
55
+ return strtof (nptr, endptr);
56
+ }
57
+
58
+ static long double swift_strtold_l (const char *nptr, char **endptr,
59
+ locale_t loc) {
60
+ return strtold (nptr, endptr);
61
+ }
62
+
63
+ #define strtod_l swift_strtod_l
64
+ #define strtof_l swift_strtof_l
65
+ #define strtold_l swift_strtold_l
47
66
#elif defined(__ANDROID__)
48
67
#include < locale.h>
49
68
@@ -369,7 +388,7 @@ static bool swift_stringIsSignalingNaN(const char *nptr) {
369
388
return strcasecmp (nptr, " snan" ) == 0 ;
370
389
}
371
390
372
- #if defined(__CYGWIN__) || defined(_WIN32) || defined(__HAIKU__) || defined(__OpenBSD__)
391
+ #if defined(__CYGWIN__) || defined(_WIN32) || defined(__HAIKU__)
373
392
// Cygwin does not support uselocale(), but we can use the locale feature
374
393
// in stringstream object.
375
394
template <typename T>
You can’t perform that action at this time.
0 commit comments