3 dnl This file contains the specific functions that are not handled in the
4 dnl m4/specific.m4 file.
9 dnl This is from GNU m4 examples file foreach.m4:
11 # foreach(x, (item_1, item_2, ..., item_n), stmt)
12 define(`foreach', `pushdef(`$1', `')_foreach(`$1', `$2',
17 `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2),
19 # traceon(`define', `foreach', `_foreach', `ifelse')
23 foreach(`ikind', `(4, 8, 16)', `foreach(`rkind', `(4, 8, 10, 16)', `
24 `#if defined (HAVE_GFC_REAL_'rkind`) && defined (HAVE_GFC_INTEGER_'ikind`)'
25 elemental function _gfortran_specific__nint_`'ikind`_'rkind (parm)
26 real (kind=rkind) , intent (in) :: parm
27 integer (kind=ikind) :: _gfortran_specific__nint_`'ikind`_'rkind
28 _gfortran_specific__nint_`'ikind`_'rkind = nint (parm)
34 foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
35 `#if defined (HAVE_GFC_INTEGER_'ikind`)'
36 elemental function _gfortran_specific__char_`'ckind`_i'ikind (parm)
37 integer (kind=ikind) , intent (in) :: parm
38 character (kind=ckind,len=1) :: _gfortran_specific__char_`'ckind`_i'ikind
39 _gfortran_specific__char_`'ckind`_i'ikind` = char (parm, kind='ckind`)'
45 foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
46 `#if defined (HAVE_GFC_INTEGER_'ikind`)'
47 elemental function _gfortran_specific__len_`'ckind`_i'ikind (parm)
48 character (kind=ckind,len=*) , intent (in) :: parm
49 integer (kind=ikind) :: _gfortran_specific__len_`'ckind`_i'ikind
50 _gfortran_specific__len_`'ckind`_i'ikind` = len (parm)'
56 foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
57 `#if defined (HAVE_GFC_INTEGER_'ikind`)'
58 elemental function _gfortran_specific__index_`'ckind`_i'ikind (parm1, parm2)
59 character (kind=ckind,len=*) , intent (in) :: parm1, parm2
60 integer (kind=ikind) :: _gfortran_specific__index_`'ckind`_i'ikind
61 _gfortran_specific__index_`'ckind`_i'ikind` = index (parm1, parm2)'