From: Włodzimierz Skiba Date: Mon, 24 Oct 2005 18:56:33 +0000 (+0000) Subject: Move wxMulDivInt32 to common math. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/068becf5625117fda98c6a6f94433c5b5147e367?ds=sidebyside Move wxMulDivInt32 to common math. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/geometry.h b/include/wx/geometry.h index 4c1e5ad871..2aa92a80f9 100644 --- a/include/wx/geometry.h +++ b/include/wx/geometry.h @@ -20,14 +20,6 @@ #include "wx/gdicmn.h" #include "wx/math.h" -#if defined(__WXMSW__) && !defined(__WXWINCE__) - #define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c ) -#elif defined( __WXMAC__ ) - #define wxMulDivInt32( a , b , c ) ( (wxInt32) ( ( (wxInt64)(a) * (wxInt64)(b) ) / (wxInt64)(c) ) ) -#else - #define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c)))) -#endif - class WXDLLIMPEXP_BASE wxDataInputStream; class WXDLLIMPEXP_BASE wxDataOutputStream; diff --git a/include/wx/math.h b/include/wx/math.h index 5c7b91e7d8..bff0683c94 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -1,10 +1,10 @@ /** -* Name: math.h +* Name: wx/math.h * Purpose: Declarations/definitions of common math functions * Author: John Labenski and others * Modified by: * Created: 02/02/03 -* RCS-ID: +* RCS-ID: $Id$ * Copyright: (c) John Labenski * Licence: wxWindows licence */ @@ -102,6 +102,14 @@ inline bool wxIsNullDouble(double x) { return wxIsSameDouble(x, 0.); } #endif /* __cplusplus */ +#if defined(__WXMSW__) && !defined(__WXWINCE__) + #define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c ) +#elif defined( __WXMAC__ ) + #define wxMulDivInt32( a , b , c ) ( (wxInt32) ( ( (wxInt64)(a) * (wxInt64)(b) ) / (wxInt64)(c) ) ) +#else + #define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c)))) +#endif + #if wxUSE_APPLE_IEEE #ifdef __cplusplus extern "C" { diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 41c5756c1d..6bc9bf36a1 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -24,7 +24,7 @@ #endif #include "wx/dcclient.h" -#include "wx/geometry.h" +#include "wx/math.h" #include "wx/msw/ole/activex.h"