MantisBT - Open CASCADE
View Issue Details
0028838Open CASCADE[OCCT] OCCT:Configurationpublic2017-06-13 08:352018-09-29 18:36
kgv 
bugmaster 
normalintegration request 
closedfixed 
[OCCT] 7.1.0 
[OCCT] 7.2.0[OCCT] 7.2.0 
Not needed
0028838: Configuration - undefine macros coming from X11 headers in place of collision
Currently several name collisions coming from X11 headers (macros Status, Convex, Opposite, FillSolid) are undefined within special header file InterfaceGraphic.hxx, which is supposed to be included instead of X11 headers.

This solution, however, is not very flexible - e.g. user have to know about InterfaceGraphic.hxx existence (while name collision occurs when using other OCCT header files) and conflicts with compilation techniques like precompiled headers.

Therefore, it is proposed to undefined name collisions in the place of their occurrence (e.g. in header files of OCCT classes using the same names as X11 macros). This will not solve the name collision issue completely (user might include X11 after OCCT headers which will make OCCT methods inaccessible), but improve the situation to some degree.
N/A
No tags attached.
parent of 0028822closed bugmaster Open CASCADE Configuration, XCAFDoc - fix name collision with macros GetObject() 
child of 0028417closed bugmaster Community Using PRECOMPILED HEADER to speed up compilation time 
Issue History
2017-06-13 08:35kgvNew Issue
2017-06-13 08:35kgvAssigned To => kgv
2017-06-13 08:36kgvRelationship addedparent of 0028822
2017-06-13 08:36kgvRelationship addedchild of 0028417
2017-06-13 08:45gitNote Added: 0067291
2017-06-13 08:50gitNote Added: 0067292
2017-06-13 08:53kgvNote Added: 0067293
2017-06-13 08:53kgvAssigned Tokgv => bugmaster
2017-06-13 08:53kgvStatusnew => resolved
2017-06-13 08:53kgvStatusresolved => reviewed
2017-06-14 19:04mkvAssigned Tobugmaster => mkv
2017-06-15 11:40mkvNote Added: 0067442
2017-06-15 11:41mkvNote Added: 0067443
2017-06-15 11:41mkvAssigned Tomkv => bugmaster
2017-06-15 11:41mkvStatusreviewed => tested
2017-06-15 11:41mkvTest case number => Not needed
2017-06-16 17:17bugmasterChangeset attached => occt master 9fd2d2c3
2017-06-16 17:17bugmasterStatustested => verified
2017-06-16 17:17bugmasterResolutionopen => fixed
2017-07-03 08:45gitNote Added: 0067889
2017-07-03 08:45gitNote Added: 0067890
2017-09-29 16:18aivFixed in Version => 7.2.0
2017-09-29 16:28aivStatusverified => closed
2018-09-29 18:36kgvRelationship addedparent of 0030179

Notes
(0067291)
git   
2017-06-13 08:45   
Branch CR28838 has been created by kgv.

SHA-1: c053750532af46e721e234ebae98f8ce27ac749b


Detailed log of new commits:

Author: ski
Date: Wed Feb 15 16:49:23 2017 +0300

    Undefine Convex within TopoDS_TVertex.hxx

Author: abv
Date: Sat Feb 11 09:15:32 2017 +0300

    Undefine CurrentDirectory macro in OSD_Process.hxx to avoid conflict due to possible previous inclusion of windows.h

Author: kgv
Date: Sat Feb 4 13:55:42 2017 +0300

    The macros AddPrinter (coming from WinAPI headers) is now undefined
    within Message_Messenger class definition having method with the same name.

Author: kgv
Date: Sat Feb 4 11:17:02 2017 +0300

    The macros Status, Convex, Opposite, FillSolid (coming from X11 headers)
    are now undefined in place of definition of methods with same name in OCCT headers.
    The usage of variables with name Status is now avoided.

Author: kgv
Date: Fri Feb 3 23:27:02 2017 +0400

    Define GL_GLEXT_LEGACY only if not already defined
(0067292)
git   
2017-06-13 08:50   
Branch CR28838_1 has been created by kgv.

SHA-1: ce63ec491114e26151c587ca769cdbbe78fd6c63


Detailed log of new commits:

Author: kgv
Date: Fri Feb 3 23:27:02 2017 +0400

    0028838: Configuration - undefine macros coming from X11 headers in place of collision
    
    The macros Status, Convex, Opposite, FillSolid (coming from X11 headers)
    are now undefined in place of definition of methods with same name in OCCT headers.
    The usage of variables with name Status is now avoided.
    
    GL_GLEXT_LEGACY is now defined only if not already defined.
    
    The macros AddPrinter (coming from WinAPI headers) is now undefined
    within Message_Messenger class definition having method with the same name.
    CurrentDirectory macro is now undefined in OSD_Process.hxx.
(0067293)
kgv   
2017-06-13 08:53   
Please test the patch.
(0067442)
mkv   
2017-06-15 11:40   
Dear BugMaster,
Branch CR28838_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: ce63ec491114e26151c587ca769cdbbe78fd6c63

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1206

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 92333642 / 92077580 [+0.28%]
Total CPU difference: 18965.39000000024 / 18989.35000000035 [-0.13%]
products component :
Total MEMORY difference: 33704984 / 33656232 [+0.14%]
Total CPU difference: 6154.110000000062 / 6179.4300000000685 [-0.41%]
Testing on Windows:
occt component :
Total MEMORY difference: 58687336 / 58684365 [+0.01%]
Total CPU difference: 17411.162409298686 / 17488.726106498834 [-0.44%]
products component :
Total MEMORY difference: 24263943 / 24224898 [+0.16%]
Total CPU difference: 6108.952359700067 / 6164.207913900061 [-0.90%]

There are no differences in images found by testdiff.
(0067443)
mkv   
2017-06-15 11:41   
Dear BugMaster,
Branch CR28838_1 from occt git-repository is TESTED.
(0067889)
git   
2017-07-03 08:45   
Branch CR28838 has been deleted by kgv.

SHA-1: c053750532af46e721e234ebae98f8ce27ac749b
(0067890)
git   
2017-07-03 08:45   
Branch CR28838_1 has been deleted by kgv.

SHA-1: ce63ec491114e26151c587ca769cdbbe78fd6c63