Archived issue #0031983

Samples - CSharp cannot be compiled "atomic<> is not supported by C++/CLI"

Open CASCADEOCCT:Samplesclosed7 public notes

Search issues

Description

Starting with WEEK-48, sample can not be compiled
It is assumed that this happened after the fix integration for
#0031921

http://jenkins-test-11.nnov.opencascade.com/view/WEEK-48_WEEK-48/view/SAMPLES/job/WEEK-48_WEEK-48-OCCT-Windows-64-VC12-sample-csharp/

Steps to reproduce

Not applicable

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: mpv
Date: Mon Dec 7 16:45:28 2020 +0300

    0031983: Samples - CSharp cannot be compiled "atomic<> is not supported by C++/CLI"
    
    Added checking of CLI compiler. If it is enabled in the visual studio, disable support of "atomic".
02Commenter 2
 Added checking of CLI compiler. If it is enabled in the visual studio, disable support of "atomic".

+#if (defined(__cplusplus) && __cplusplus >= 201100L) || \
+    (defined(_MSC_VER) && _MSC_VER >= 1800 && _MANAGED != 1 && _M_CEE != 1) || \

That might have unexpected result.

OCCT itself is compiled without C++/CLI flag - it is only used by C# sample which might include OCCT headers in C++/CLI code and link to C++ OCCT libraries.
As atomic is used in TDF_Label class header for a member, it might produce mismatching declaration of TDF_Label in OCCT itself and C# sample, and potentially runtime crash (if ugly atomic implementation is different in size than a raw pointer).
03Commenter 1
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: mpv
Date: Wed Dec 16 14:49:13 2020 +0300

    0031983: Samples - CSharp cannot be compiled "atomic<> is not supported by C++/CLI"
    
    Removed includes-dependency of the CSharp sample from TDF_Label.hxx
04Commenter 4
It seems it is compiled well now.
OCCT: CR31983_2
Products: nothing
05Author
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17709.570000000054 / 17744.450000000124 [-0.20%]
Products
Total CPU difference: 12258.480000000121 / 12330.210000000125 [-0.58%]
Windows-64-VC14:
OCCT
Total CPU difference: 19272.796875 / 19429.1875 [-0.80%]
Products
Total CPU difference: 13712.859375 / 13755.5 [-0.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
06Commenter 1
Branch [archived branch] has been deleted by Participant.

[revision removed]
07Commenter 1
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records