diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-06-19 06:58:22 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-06-19 06:58:22 +0000 |
| commit | be13be47bac8b0d35283cf1525e51a7d1d6e6455 (patch) | |
| tree | b0bfa874cfb1a1f44a90127b3868f0d0f339be5e /libcxx/include/support/solaris | |
| parent | 3119599475c5f989f22e8591577777e2861f9296 (diff) | |
| download | bcm5719-llvm-be13be47bac8b0d35283cf1525e51a7d1d6e6455.tar.gz bcm5719-llvm-be13be47bac8b0d35283cf1525e51a7d1d6e6455.zip | |
Implement LWG issue 1169. num_get not fully compatible with strto*
Use strtof and strtod for floats and doubles respectively instead of
always using strtold. The other parts of the change are already implemented
in libc++.
This patch also has a drive by fix to wbuffer_convert::underflow() which
prevents it from calling memmove(buff, null, 0).
llvm-svn: 273106
Diffstat (limited to 'libcxx/include/support/solaris')
| -rw-r--r-- | libcxx/include/support/solaris/xlocale.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libcxx/include/support/solaris/xlocale.h b/libcxx/include/support/solaris/xlocale.h index 62b0d74a6d2..e20ef7a6e53 100644 --- a/libcxx/include/support/solaris/xlocale.h +++ b/libcxx/include/support/solaris/xlocale.h @@ -44,11 +44,6 @@ long strtol_l(const char *__nptr, char **__endptr, return strtol(__nptr, __endptr, __base); } static inline -long double strtold_l(const char *__nptr, char **__endptr, - locale_t __loc) { - return strtold(__nptr, __endptr); -} -static inline unsigned long long strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) { return strtoull(__nptr, __endptr, __base); @@ -58,6 +53,21 @@ unsigned long strtoul_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) { return strtoul(__nptr, __endptr, __base); } +static inline +float strtof_l(const char *__nptr, char **__endptr, + locale_t __loc) { + return strtof(__nptr, __endptr); +} +static inline +double strtod_l(const char *__nptr, char **__endptr, + locale_t __loc) { + return strtod(__nptr, __endptr); +} +static inline +long double strtold_l(const char *__nptr, char **__endptr, + locale_t __loc) { + return strtold(__nptr, __endptr); +} #ifdef __cplusplus |

