Index: inc/sal/types.h =================================================================== RCS file: /cvs/porting/sal/inc/sal/types.h,v retrieving revision 1.29 diff -u -p -r1.29 types.h --- inc/sal/types.h 20 Jun 2006 04:15:50 -0000 1.29 +++ inc/sal/types.h 2 Feb 2007 08:45:50 -0000 @@ -333,6 +333,10 @@ enum __sal_NoAcquire #ifdef __cplusplus +#if OSL_DEBUG_LEVEL > 0 +# include +#endif + namespace sal { /** @@ -344,10 +348,16 @@ namespace sal { type of any of the expressions involved in the compiler warning is changed can be found more easily. - Both template arguments T1 and T2 must be integral types. + Both template arguments T1 and T2 must be arithmetic types + (colloquially referred to as 'ints' and 'floating point'). */ -template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) { +template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) +{ +#if OSL_DEBUG_LEVEL > 0 + return boost::numeric_cast(n); +#else return static_cast< T1 >(n); +#endif } }