Haiku OS support; thanks to MrSunshine

This commit is contained in:
Moritz Warning
2010-10-04 00:58:14 +02:00
parent 2490631d5b
commit 233299e5c8
8 changed files with 39 additions and 6 deletions

View File

@@ -1704,7 +1704,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)
{