DiscussionsIssue archiveOCCT:Foundation Classes

Archived issue #0018387

Macro conflict for M_PI_2 and M_SQRT1_2 with math.h

CommunityOCCT:Foundation Classesclosed5 public notes

Search issues

Description

From:
Stephane Routelous <[email removed]>

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.[revision removed]-1
#define M_PI_2 1.[revision removed]
definitions in Attachment 1 (HXX) are conflicting with the same ones from math.h

Could you please enclose the definitions in Attachment 1 (HXX) with #ifndef /
#endif ?

#ifndef M_SQRT1_2
#define M_SQRT1_2 7.[revision removed]-1
#endif

#ifndef M_PI_2
#define M_PI_2 1.[revision removed]
#endif

Thanks,

Stephane

Public activity

5 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Fixed in branch 0018387.
02Commenter 2
For review.
03Commenter 3
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
04Commenter 4
Fixed in the branch OCC22792: http://svn/svn/occt/branches/OCC22792
I attached fixed file.

Dear Andrey,
Please review the fix.

05Commenter 5
Integrated with #22792