Applyed Haiku patch by MrSunshine

This commit is contained in:
Alexey Prokhin
2010-10-08 10:19:46 +04:00
parent 9f26583e52
commit 5be6206eb8
6 changed files with 29 additions and 3 deletions
+12 -1
View File
@@ -1881,7 +1881,18 @@ void floatToBuffer(OutBuffer *buf, Type *type, real_t value)
if (r == value) // if exact duplication
buf->writestring(buffer);
else
buf->printf("%La", value); // ensure exact duplication
{
#ifdef __HAIKU__ // broken printf workaround
char buffer2[25];
char *ptr = (char *)&value;
for(int i = 0; i < sizeof(value); i++)
snprintf(buffer2, sizeof(char), "%x", ptr[i]);
buf->writestring(buffer2);
#else
buf->printf("%La", value); // ensure exact duplication
#endif
}
if (type)
{