1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024234: occt master is not compiled by VC++ 2005 (vc8 32/64 bit TKBO)

Fixed building by VS 2005 and VS 2013 (Express):
- macro _WIN32_WINNT defined in BOPCol_TBB.hxx for building with TBB on VS 2005
- compiler warnings specific for VS 2005 (vc8) fixed (explicit casts added in assignment expressions involving small integer types)
- definition of functions atanh, acosh, asinh is avoided for vc12 and later (they are provided by CRT in vc12)
- math constants (M_PI and similar) are defined by including math.h rather than by custom code
- misuse of stream operator << fixed in a few places
This commit is contained in:
abv
2013-10-31 00:44:20 +04:00
committed by bugmaster
parent 2b3ac0cf2d
commit 008aef40eb
14 changed files with 43 additions and 50 deletions

View File

@@ -357,8 +357,8 @@ Standard_UUID Standard_GUID::ToUUID() const
result.Data1 = my32b ;
result.Data2 = my16b1 ;
result.Data3 = my16b2 ;
result.Data4[0] = my16b3 >> 8 ;
result.Data4[1] = (char ) my16b3 ;
result.Data4[0] = (unsigned char)(my16b3 >> 8);
result.Data4[1] = (char) my16b3;
result.Data4[2] = my8b1 ;
result.Data4[3] = my8b2 ;
result.Data4[4] = my8b3 ;

View File

@@ -16,17 +16,10 @@
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
// -------------------------------------------------------------------------
// Definition des fonctions mathematiques hyperboliques: acosh, asinh, atanh
// pour Windows/NT uniquement.
// -------------------------------------------------------------------------
#ifdef WNT
#include <math.h>
#include <Standard_math.hxx>
#ifndef _Standard_MacroHeaderFile
# include <Standard_Macro.hxx>
#endif // _Standard_MacroHeaderFile
// MSVC versions prior to 12 did not provided acosh, asinh, atanh functions in standard library
#if defined(_MSC_VER) && (_MSC_VER < 1800)
Standard_EXPORT double __cdecl acosh( double X)
{
@@ -53,4 +46,5 @@ Standard_EXPORT double __cdecl atanh( double X)
res = log((1 + X) / (1 - X)) / 2;
return res;
};
#endif

View File

@@ -20,31 +20,17 @@
#include <Standard_Macro.hxx>
#endif
#ifdef WNT
#ifdef _MSC_VER
# ifndef __MATH_WNT_H
# define __MATH_WNT_H
#define _USE_MATH_DEFINES
#include <math.h>
// MSVC versions prior to 12 did not provided acosh, asinh, atanh functions in standard library
#if _MSC_VER < 1800
__Standard_API double __cdecl acosh ( double );
__Standard_API double __cdecl asinh ( double );
__Standard_API double __cdecl atanh ( double );
#endif
# ifdef M_SQRT1_2
# undef M_SQRT1_2
# endif
# define M_SQRT1_2 0.707106781186547524401
# ifdef M_PI_2
# undef M_PI_2
# endif
# define M_PI_2 1.57079632679489661923
# ifdef M_PI
# undef M_PI
# endif
# define M_PI 3.14159265358979323846
# endif /* __MATH_WNT_H */
#endif /* WNT */
#endif /* _MSC_VER */