View Issue Details

IDProjectCategoryView StatusLast Update
0018387CommunityOCCT:Foundation Classespublic2011-12-20 17:32
Reporterbugmaster Assigned Toabv 
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Target Version6.5.3Fixed in Version6.5.3 
Summary0018387: Macro conflict for M_PI_2 and M_SQRT1_2 with math.h
DescriptionFrom:
Stephane Routelous <stephane.routelous@exotk.org>

This message was sent from www.opencascade.org forum.
http://www.opencascade.org/org/forum/thread_12623/
------------------------------------------------------


When using the _USE_MATH_DEFINES preprocessor definition, the
#define M_SQRT1_2 7.0710678118654752440E-1
#define M_PI_2 1.5707963267948966192E0
definitions in Standard_math.hxx are conflicting with the same ones from math.h

Could you please enclose the definitions in Standard_math.hxx with #ifndef /
#endif ?

#ifndef M_SQRT1_2
#define M_SQRT1_2 7.0710678118654752440E-1
#endif

#ifndef M_PI_2
#define M_PI_2 1.5707963267948966192E0
#endif

Thanks,

Stephane
TagsNo tags attached.
Test case numbernot needed

Attached Files

  • Standard_math.hxx (1,043 bytes)

Activities

szy

2011-08-18 16:01

manager   ~0018000

Fixed in branch 0018387.

szy

2011-12-01 12:25

manager   ~0018688

For review.

abv

2011-12-01 13:20

manager   ~0018691

Review remark: I suggest that we (a) update value of M_SQRT1_2 to be equal to that defined in MS VC++ headers (avoid use of exponent and add one more digit '1' at the end) and (b) enforce redefinition of these values if already defined, to be sure that we always use the same values throughout OCCT regardless of the platform

dbv

2011-12-05 15:01

developer  

Standard_math.hxx (1,043 bytes)

dbv

2011-12-05 15:06

developer   ~0018741

Fixed in the branch OCC22792: http://svn/svn/occt/branches/OCC22792
I attached fixed file.

Dear Andrey,
Please review the fix.

abv

2011-12-20 17:31

manager   ~0018925

Integrated with #22792

Issue History

Date Modified Username Field Change
2010-10-06 19:02 bugmaster Status closed => assigned
2010-10-06 19:02 bugmaster Resolution suspended => @0@
2010-10-06 19:03 bugmaster Assigned To bugmaster => abv
2011-04-07 18:16 bugmaster Assigned To abv => szy
2011-04-22 18:12 szy Status assigned => resolved
2011-08-02 11:23 bugmaster Category OCCT:FDC => OCCT:Foundation Classes
2011-08-18 16:00 szy Status resolved => assigned
2011-08-18 16:01 szy Note Added: 0018000
2011-08-18 16:01 szy Status assigned => resolved
2011-09-20 17:31 szy Fixed in Version EMPTY =>
2011-09-20 17:31 szy Target Version => 6.5.2
2011-09-20 17:31 szy Description Updated
2011-09-21 11:07 bugmaster Target Version 6.5.2 => 6.5.3
2011-12-01 12:25 szy Note Added: 0018688
2011-12-01 12:25 szy Assigned To szy => abv
2011-12-01 12:25 szy Status resolved => assigned
2011-12-01 12:40 abv Status assigned => resolved
2011-12-01 13:20 abv Note Added: 0018691
2011-12-01 13:20 abv Assigned To abv => szy
2011-12-01 13:20 abv Status resolved => assigned
2011-12-02 15:46 abv Assigned To szy => dbv
2011-12-05 15:00 dbv File Deleted: Standard_math.hxx
2011-12-05 15:01 dbv File Added: Standard_math.hxx
2011-12-05 15:06 dbv Note Added: 0018741
2011-12-05 15:06 dbv Assigned To dbv => abv
2011-12-05 15:06 dbv Status assigned => resolved
2011-12-13 18:49 mkv Test case number => Test case is not required
2011-12-20 17:31 abv Test case number Test case is not required => not needed
2011-12-20 17:31 abv Note Added: 0018925
2011-12-20 17:31 abv Status resolved => closed
2011-12-20 17:32 abv Fixed in Version => 6.5.3