Merge pull request #72 from XeCycle/fionread-solaris

Some portability fixes for Solaris-like systems
This commit is contained in:
Martijn Otto 2016-06-27 10:57:24 +02:00 committed by GitHub
commit 2f1851728c
2 changed files with 10 additions and 3 deletions

View File

@ -108,7 +108,7 @@ public:
virtual void output(std::ostream &stream) const override
{
// output floating point value
stream << "decimal(" << _number / pow(10, _places) << ")";
stream << "decimal(" << _number / pow(10.0f, _places) << ")";
}
/**
@ -138,7 +138,7 @@ public:
*/
virtual operator double() const override
{
return _number / pow(10, _places);
return _number / pow(10.0f, _places);
}
/**
@ -149,7 +149,7 @@ public:
*/
virtual operator float() const override
{
return static_cast<float>(_number / pow(10, _places));
return static_cast<float>(_number / pow(10.0f, _places));
}
/**

View File

@ -19,6 +19,13 @@
#include <sys/ioctl.h>
#include <sys/uio.h>
/**
* FIONREAD on Solaris is defined elsewhere
*/
#ifdef __sun
#include <sys/filio.h>
#endif
/**
* Set up namespace
*/