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++.
7676
7777The examples "array", "malloc", "vector" show distinct ways to send arrays to/from Fortran with C and C++.
7878
79+ ### bool
80+
81+ Made workaround for [ nvfortran] ( https://forums.developer.nvidia.com/t/nvfortran-c-bool-bind-c-not-improper-value/291896 ) .
82+
7983### Error handling
8084
8185Using 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)
2020Ld = .false.
2121
2222! > 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.
2326! logical_not = .not. L
2427if (L) then
2528 logical_not = .false. _C_BOOL
You can’t perform that action at this time.
0 commit comments