Hyperbolic functions

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Fri May 30 09:40:11 CEST 2008


> Von: Pau Garcia i Quiles
> Hello,
> 
> As MSVC does not implement atanh, it's being defined in  
> kdeedu/marble/src/lib/PlaceMarkLayout.cpp and  
> kdeedu/marble/src/lib/Projections/MercatorProjection.cpp as:
> 
> #ifdef Q_CC_MSVC
> static double msvc_atanh(double x)
> {
>    return ( 0.5 * log( ( 1.0 + x ) / ( 1.0 - x ) ) );
> }
> #define atanh msvc_atanh
> #endif
> 
> Now I've copied that to  
> kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h and  
> kdeedu/marble/src/lib/VectorMap.cpp too, which means the same code is  
> duplicated in 4 different places.
> 
> Also, I moved the definition of msvc_asinh from  
> kdeedu/marble/src/lib/EquirectScanlineTextureMapper.cpp to  
> kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h, which is  
> included by EquirectScanlineTextureMapper.h, which is included by  
> EquirectScanlineTextureMapper.cpp. This has been just a coincidence,  
> we may have ended up with the same code in 2 different places.
> 
> Wouldn't it make sense to move the definition of hyperbolic functions  
> to some other place, maybe inlined in msvc/math.h :-?
> 
This is a marble-only problem. The functions are already in kdewin32 lib. The problem is that marble should not link against kdewin32 to be able to compile marble qt-only.
So add a asinh function to a well-known marble place, name it msvc_asinh() and all is fine.


Christian
-- 
Super-Aktion nur in der GMX Spieleflat: 10 Tage für 1 Euro.
Über 180 Spiele downloaden: http://flat.games.gmx.de


More information about the Kde-windows mailing list