diff options
Diffstat (limited to 'libgfortran/m4/iparm.m4')
-rw-r--r-- | libgfortran/m4/iparm.m4 | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/libgfortran/m4/iparm.m4 b/libgfortran/m4/iparm.m4 index 6cbd7b247a8..7b1cdebefc8 100644 --- a/libgfortran/m4/iparm.m4 +++ b/libgfortran/m4/iparm.m4 @@ -3,24 +3,30 @@ dnl Works out all the function types from the filename. dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran) dnl Distributed under the GNU LGPL. See COPYING for details. dnl M4 macro file to get type names from filenames -include(`types.m4') -define(type_letter, regexp(file, `_\([irlc]\)[^_]*$', \1))dnl -define(type_kind, regexp(file, `_[irlc]\([0-9]*\)[^_]*$', \1))dnl -define(rtype_kind, regexp(file, `_\([0-9]*\)_[irlc][0-9]*[^_]*$', `\1'))dnl -define(type_code, type_letter`'type_kind)dnl -define(type_name, get_typename(type_letter,type_kind))dnl -define(atype, get_arraytype(type_letter,type_kind))dnl -ifelse(rtype_kind,, -`define(rtype_letter,type_letter)dnl -define(rtype_name, type_name)dnl -define(rtype_code, type_code)dnl -define(rtype, atype)dnl +define(get_typename2, `GFC_$1_$2')dnl +define(get_typename, `get_typename2(ifelse($1,i,INTEGER,ifelse($1,r,REAL,ifelse($1,l,LOGICAL,ifelse($1,c,COMPLEX,unknown)))),`$2')')dnl +define(get_arraytype, `gfc_array_$1$2')dnl +define(define_type, `dnl +ifelse(regexp($2,`^[0-9]'),-1,`dnl +define($1_letter, substr($2, 0, 1))dnl +define($1_kind, substr($2, 1))dnl +',`dnl +define($1_letter,i)dnl +define($1_kind,$2)dnl +')dnl +define($1_code,$1_letter`'$1_kind)dnl +define($1,get_arraytype($1_letter,$1_kind))dnl +define($1_name, get_typename($1_letter, $1_kind))')dnl +dnl +define_type(atype, regexp(file, `_\(.?[0-9]*\)\.c$', `\1'))dnl +define(rtype_tmp, regexp(file, `_\(.?[0-9]*\)_[^_]*\.c$', `\1'))dnl +ifelse(rtype_tmp,,`dnl +define_type(rtype, atype_code)dnl define(rtype_qual,`')dnl -', -`define(rtype_letter,i)dnl -define(rtype_name, get_typename(rtype_letter,rtype_kind))dnl -define(rtype, get_arraytype(rtype_letter,rtype_kind))dnl +',`dnl +define_type(rtype, rtype_tmp)dnl define(rtype_qual,`_'rtype_kind)dnl ')dnl -define(type_max, type_name`_HUGE')dnl -define(type_min, `-'type_max)dnl +define(atype_max, atype_name`_HUGE')dnl +define(atype_min, `-'atype_max)dnl +define(name, regexp(regexp(file, `[^/]*$', `\&'), `^\([^_]*\)_', `\1'))dnl |