Your two options that I can think of are to translate your own version iso_c_bindingfor systems that do not have this module ( as suggested by @HighPerformanceMark ) or use preprocessors to conditionally compile parts of your code depending on the version of the compiler. In both cases, you will have to work for your code to be portable across systems. As suggested by @HighPerformanceMark, you can copy and paste the iso_c_bindingopen source implementation, but for each new system you transfer your code, you will need to check the correctness of this implementation.
, , , iso_c_binding , . , " GCC, ". , , , , .
, . gfortran:
GNU Fortran , __GFORTRAN__ __GNUC__, __GNUC_MINOR__ __GNUC_PATCHLEVEL__ .
, precomp.inc, , , . , , iso_c_binding, HAS_ISO_C_BINDING ( ). precomp.inc . :
!> \file precomp.inc
!! Preprocessor feature detection.
#if defined(__GFORTRAN__)
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
#define HAS_ISO_C_BINDING 1
#else
#define HAS_ISO_C_BINDING 0
#endif
#elif defined(__INTEL_COMPILER)
#error "I haven't implemented this yet..."
#else
#error "Compiler not yet supported."
#endif
#else HAS_ISO_C_BINDING=0, iso_c_binding.
Fortran :
program main
use iso_c_binding
implicit none
end program main
, , , iso_c_binding . , @HighPerformanceMark, , . , iso_c_binding , , , .