Switch to gdtoa.

This gives us a real strtold for LP64 and fixes various LP64
bugs.

Bug: 13563801
Change-Id: I277858d718ee746e136b6b6308a495ba50dfa488
This commit is contained in:
Elliott Hughes
2014-04-10 17:48:14 -07:00
parent 26c2bb84dd
commit 4bd97cee28
33 changed files with 7907 additions and 2855 deletions

View File

@@ -28,7 +28,16 @@
#include <stdlib.h>
extern "C" int __strtorQ(const char*, char**, int, void*);
long double strtold(const char* s, char** end_ptr) {
// TODO: this is fine for LP32 where double == long double, but is broken on LP64.
#if __LP64__
long double result;
// TODO: use the current rounding mode?
__strtorQ(s, end_ptr, 1 /* FPI_Round_near */, &result);
return result;
#else
// This is fine for LP32 where long double is just double.
return strtod(s, end_ptr);
#endif
}