diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-07 08:03:01 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-07 08:03:34 +0100 |
commit | f996a5a153e1b7ff81d9343eedee244e585ecab9 (patch) | |
tree | feb1915f266ed6b4e8e1ff0ee24f0cd39c9cf251 /basic | |
parent | c0c69ccd2aac45e4cca0de7d4deaa6d02ec27f4d (diff) |
basic: fix Android build
rtl::math::round() is fine here, I guess.
Change-Id: I4d92bc191182ff531e11d20ef87c69dc99da2b32
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxbyte.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxchar.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxconv.hxx | 13 | ||||
-rw-r--r-- | basic/source/sbx/sbxint.cxx | 14 | ||||
-rw-r--r-- | basic/source/sbx/sbxlng.cxx | 8 |
5 files changed, 18 insertions, 31 deletions
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index 562979b4c37e..9d52eebec395 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -21,7 +21,7 @@ #include <basic/sbx.hxx> #include "sbxconv.hxx" -#include <cmath> +#include <rtl/math.hxx> sal_uInt8 ImpGetByte( const SbxValues* p ) { @@ -123,7 +123,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt8) std::lround( p->nSingle ); + nRes = (sal_uInt8) rtl::math::round( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -149,7 +149,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt8) std::lround( dVal ); + nRes = (sal_uInt8) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx index 81d195c188e1..478a9d556adf 100644 --- a/basic/source/sbx/sbxchar.cxx +++ b/basic/source/sbx/sbxchar.cxx @@ -21,7 +21,7 @@ #include <basic/sbx.hxx> #include "sbxconv.hxx" -#include <cmath> +#include <rtl/math.hxx> sal_Unicode ImpGetChar( const SbxValues* p ) { @@ -111,7 +111,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_Unicode) std::lround( p->nSingle ); + nRes = (sal_Unicode) rtl::math::round( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -137,7 +137,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_uInt8) std::lround( dVal ); + nRes = (sal_uInt8) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -158,7 +158,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_Unicode) std::lround( d ); + nRes = (sal_Unicode) rtl::math::round( d ); } break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx index 34a9ba324b93..08fa296f2c8f 100644 --- a/basic/source/sbx/sbxconv.hxx +++ b/basic/source/sbx/sbxconv.hxx @@ -21,19 +21,6 @@ #define INCLUDED_BASIC_SOURCE_SBX_SBXCONV_HXX #include "sbxdec.hxx" -#if defined(ANDROID) -namespace std -{ -double lround(double d) -{ - return d + ( d < 0 ? -0.5 : 0.5 ); -} -double llround(double d) -{ - return d + ( d < 0 ? -0.5 : 0.5 ); -} -} -#endif class SbxArray; diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index b3d4cd30433b..41886a68e648 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -21,7 +21,7 @@ #include <basic/sbx.hxx> #include "sbxconv.hxx" -#include <cmath> +#include <rtl/math.hxx> sal_Int16 ImpGetInteger( const SbxValues* p ) { @@ -81,7 +81,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( p->nSingle ); + nRes = (sal_Int16) rtl::math::round( p->nSingle ); break; case SbxCURRENCY: { @@ -142,7 +142,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( dVal ); + nRes = (sal_Int16) rtl::math::round( dVal ); break; } case SbxLPSTR: @@ -165,7 +165,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( d ); + nRes = (sal_Int16) rtl::math::round( d ); } break; case SbxOBJECT: @@ -347,7 +347,7 @@ sal_Int64 ImpDoubleToSalInt64( double d ) SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINSALINT64; } else - nRes = (sal_Int64) std::llround( d ); + nRes = (sal_Int64) rtl::math::round( d ); return nRes; } @@ -363,7 +363,7 @@ sal_uInt64 ImpDoubleToSalUInt64( double d ) SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt64) std::llround( d ); + nRes = (sal_uInt64) rtl::math::round( d ); return nRes; } @@ -713,7 +713,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt64) std::llround( d ); + nRes = (sal_uInt64) rtl::math::round( d ); } else if( n64 < 0 ) { diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index a5fcbadbad71..73f503d3f98e 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -21,7 +21,7 @@ #include <basic/sbx.hxx> #include "sbxconv.hxx" -#include <cmath> +#include <rtl/math.hxx> sal_Int32 ImpGetLong( const SbxValues* p ) { @@ -65,7 +65,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( p->nSingle ); + nRes = (sal_Int32) rtl::math::round( p->nSingle ); break; case SbxSALINT64: nRes = p->nInt64; @@ -106,7 +106,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( dVal ); + nRes = (sal_Int32) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -129,7 +129,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( d ); + nRes = (sal_Int32) rtl::math::round( d ); } break; case SbxOBJECT: |