[Kde-games-devel] KPat broken for Windows
Parker Coates
parker.coates at gmail.com
Mon Aug 17 18:14:35 CEST 2009
On Mon, Aug 17, 2009 at 09:40, Casper van Donderen wrote:
> Hi, While trying to compile trunk KPat fails for me on this part:
>
> if ( std::signbit( p->pilePos().x() ) == std::signbit(
> p->reservedSpace().width() ) )
> neededPileArea.setWidth( qAbs( p->pilePos().x() +
> p->reservedSpace().width() ) );
> else
> neededPileArea.setWidth( qMax( qAbs( p->pilePos().x() ),
> qAbs( p->reservedSpace().width() ) ) );
>
> if ( std::signbit( p->pilePos().y() ) == std::signbit(
> p->reservedSpace().height() ) )
> neededPileArea.setHeight( qAbs( p->pilePos().y() +
> p->reservedSpace().height() ) );
> else
> neededPileArea.setHeight( qMax( qAbs( p->pilePos().y() ),
> qAbs( p->reservedSpace().height() ) ) );
>
> (dealer.cpp line 1925 onwards)
>
> signbit() is not available in BSD & (MSVC) Windows. it is not
> available in math.h on Windows.
Hmm. That's interesting. On such platforms, how does one determine the
sign of a floating point number with proper handling of -0.0? In most
situations "n >= 0.0" is enough, but that returns true if n is -0.0.
> Please use another solution for this....
Fortunately for us, the code in question can probably get by without
properly handling -0.0 (although it would be nice if it could), so I
replaced the conditions with simple comparisons. See
http://websvn.kde.org/?view=rev&revision=1012405 .
Parker
More information about the kde-games-devel
mailing list