specific2.m4 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. include(head.m4)
  2. define(atype_code,regexp(file,`_\([ircl][0-9]+\).[fF]90',`\1'))dnl
  3. define(atype_letter,substr(atype_code, 0, 1))dnl
  4. define(atype_kind,substr(atype_code, 1))dnl
  5. define(get_typename2, `$1 (kind=$2)')dnl
  6. define(get_typename, `get_typename2(ifelse($1,i,integer,ifelse($1,r,real,ifelse($1,l,logical,ifelse($1,c,complex,unknown)))),`$2')')dnl
  7. define(atype_name, get_typename(atype_letter,atype_kind))dnl
  8. define(name, regexp(regexp(file, `[^/]*$', `\&'), `^_\([^_]*\)_', `\1'))dnl
  9. define(function_name,`_gfortran_specific__'name`_'atype_code)dnl
  10. define(Q,ifelse(atype_kind,4,F,ifelse(atype_kind,8,`',ifelse(atype_kind,10,L,ifelse(atype_kind,16,L,`_'atype_kind)))))dnl
  11. #include "config.h"
  12. #include "kinds.inc"
  13. #include "c99_protos.inc"
  14. `#if defined (HAVE_GFC_'ifelse(atype_letter,l,LOGICAL,ifelse(atype_letter,i,INTEGER,ifelse(atype_letter,r,REAL,ifelse(atype_letter,c,COMPLEX,UNKNOW))))`_'atype_kind`)'
  15. ifelse(name,atan2,`#ifdef HAVE_ATAN2'Q,)
  16. elemental function function_name (p1, p2)
  17. atype_name, intent (in) :: p1, p2
  18. atype_name :: function_name
  19. function_name = name (p1, p2)
  20. end function
  21. ifelse(name,atan2,`#endif',)
  22. #endif