File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ There are also some Fortran main programs calling C or C++.
76
76
77
77
The examples "array", "malloc", "vector" show distinct ways to send arrays to/from Fortran with C and C++.
78
78
79
+ ### bool
80
+
81
+ Made workaround for [ nvfortran] ( https://forums.developer.nvidia.com/t/nvfortran-c-bool-bind-c-not-improper-value/291896 ) .
82
+
79
83
### Error handling
80
84
81
85
Using Fortran statement "stop" or "error stop" with a C/C++ main program works like with a Fortran main program.
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ logical(c_bool) function logical_not(L) bind(C)
20
20
Ld = .false.
21
21
22
22
! > workaround for nvfortran 24.3 etc.
23
+ ! ! nvfortran reference guide:
24
+ ! ! The logical constants .TRUE. and .FALSE. are defined to be the four-byte values -1 and 0 respectively.
25
+ ! ! A logical expression is defined to be .TRUE. if its least significant bit is 1 and .FALSE. otherwise.
23
26
! logical_not = .not. L
24
27
if (L) then
25
28
logical_not = .false. _C_BOOL
You can’t perform that action at this time.
0 commit comments