Archived issue #0018387
Macro conflict for M_PI_2 and M_SQRT1_2 with math.h
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
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.
Fixed in branch 0018387.
For review.
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
Fixed in the branch OCC22792: http://svn/svn/occt/branches/OCC22792
I attached fixed file.
Dear Andrey,
Please review the fix.
I attached fixed file.
Dear Andrey,
Please review the fix.
Integrated with #22792