Execute f32() if platform is 32-bit, or f64() if platform is 64-bit. This can be either a compile-time condition (depending on target) or a runtime detection.
program main
useiso_c_bindingimplicitnonetype(c_ptr) :: x
logical, parameter :: is_64 = c_sizeof(x) == 8if (is_64) thencall f64
elsecall f32
endifendprogram main
This checks the size of the standard C interop pointer and deduces the system type from that.
import"strconv"
if strconv.IntSize==32 {
f32()
}
if strconv.IntSize==64 {
f64()
}
program main
use iso_c_binding
implicit none
type(c_ptr) :: x
logical, parameter :: is_64 = c_sizeof(x) == 8
if (is_64) then
call f64
else
call f32
end if
end program main