diff options
author | Richard Henderson <rth@redhat.com> | 2004-12-12 00:59:05 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-12-12 00:59:05 -0800 |
commit | 7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35 (patch) | |
tree | cb0ecd2cd7b8c21d4d1c38261b5b7116e8dd2782 | |
parent | c431e4997fcca052667b780341ddf4df5f6eb55c (diff) | |
download | gcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.zip gcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.tar.gz gcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.tar.bz2 |
acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
(LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New.
(LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New.
* configure.ac: Use them.
* configure, config.h.in, aclocal.m4: Rebuild.
* libgfortran.h (prefix): Remove.
(PREFIX, IPREFIX): New.
(sym_rename, sym_rename1, sym_rename2): New.
(internal_proto, export_proto, export_proto_np): New.
(iexport_proto, iexport): New.
(iexport_data_proto, iexport_data): New.
* intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c,
intrinsics/cpu_time.c, intrinsics/cshift0.c,
intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c,
intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c,
intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c,
intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c,
intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c,
intrinsics/reshape_generic.c, intrinsics/size.c,
intrinsics/spread_generic.c, intrinsics/stat.c,
intrinsics/string_intrinsics.c, intrinsics/system.c,
intrinsics/system_clock.c, intrinsics/transpose_generic.c,
intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c,
io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h,
io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4,
m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4,
m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4,
m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4,
m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4,
m4/transpose.m4, runtime/environ.c, runtime/error.c,
runtime/in_pack_generic.c, runtime/in_unpack_generic.c,
runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c,
runtime/stop.c: Use them to mark symbols internal or external.
* generated/*: Rebuild.
From-SVN: r92045
181 files changed, 2040 insertions, 756 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 971b59d..83084aa 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,40 @@ +2004-12-12 Richard Henderson <rth@redhat.com> + + * acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New. + (LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New. + (LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New. + * configure.ac: Use them. + * configure, config.h.in, aclocal.m4: Rebuild. + * libgfortran.h (prefix): Remove. + (PREFIX, IPREFIX): New. + (sym_rename, sym_rename1, sym_rename2): New. + (internal_proto, export_proto, export_proto_np): New. + (iexport_proto, iexport): New. + (iexport_data_proto, iexport_data): New. + * intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c, + intrinsics/cpu_time.c, intrinsics/cshift0.c, + intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c, + intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c, + intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c, + intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c, + intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c, + intrinsics/reshape_generic.c, intrinsics/size.c, + intrinsics/spread_generic.c, intrinsics/stat.c, + intrinsics/string_intrinsics.c, intrinsics/system.c, + intrinsics/system_clock.c, intrinsics/transpose_generic.c, + intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c, + io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h, + io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4, + m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, + m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4, + m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4, + m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4, + m4/transpose.m4, runtime/environ.c, runtime/error.c, + runtime/in_pack_generic.c, runtime/in_unpack_generic.c, + runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c, + runtime/stop.c: Use them to mark symbols internal or external. + * generated/*: Rebuild. + 2004-12-09 David Edelsohn <edelsohn@gnu.org> PR bootstrap/18895 diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 87dc722..2dc8f85 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -102,3 +102,49 @@ else [Define to 1 if the target is ILP32.]) fi ]) + +dnl Check whether the target supports hidden visibility. +AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY], [ + AC_CACHE_CHECK([whether the target supports hidden visibility], + have_attribute_visibility, [ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }], + [], have_attribute_visibility=yes, + have_attribute_visibility=no) + CFLAGS="$save_CFLAGS"]) + if test $have_attribute_visibility = yes; then + AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, + [Define to 1 if the target supports __attribute__((visibility(...))).]) + fi]) + +dnl Check whether the target supports dllexport +AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT], [ + AC_CACHE_CHECK([whether the target supports dllexport], + have_attribute_dllexport, [ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }], + [], have_attribute_dllexport=yes, + have_attribute_dllexport=no) + CFLAGS="$save_CFLAGS"]) + if test $have_attribute_dllexport = yes; then + AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1, + [Define to 1 if the target supports __attribute__((dllexport)).]) + fi]) + +dnl Check whether the target supports symbol aliases. +AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_ALIAS], [ + AC_CACHE_CHECK([whether the target supports symbol aliases], + have_attribute_alias, [ + AC_TRY_LINK([ +#define ULP STR1(__USER_LABEL_PREFIX__) +#define STR1(x) STR2(x) +#define STR2(x) #x +void foo(void) { } +extern void bar(void) __attribute__((alias(ULP "foo")));], + [bar();], have_attribute_alias=yes, have_attribute_alias=no)]) + if test $have_attribute_alias = yes; then + AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1, + [Define to 1 if the target supports __attribute__((alias(...))).]) + fi]) diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index a705e84..b858c4e 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -15,6 +15,15 @@ /* libm includes atanf */ #undef HAVE_ATANF +/* Define to 1 if the target supports __attribute__((alias(...))). */ +#undef HAVE_ATTRIBUTE_ALIAS + +/* Define to 1 if the target supports __attribute__((dllexport)). */ +#undef HAVE_ATTRIBUTE_DLLEXPORT + +/* Define to 1 if the target supports __attribute__((visibility(...))). */ +#undef HAVE_ATTRIBUTE_VISIBILITY + /* libm includes ceilf */ #undef HAVE_CEILF diff --git a/libgfortran/configure b/libgfortran/configure index 485391d..0a5c3f1 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -11291,6 +11291,211 @@ _ACEOF fi +# Check out attribute support. + + echo "$as_me:$LINENO: checking whether the target supports hidden visibility" >&5 +echo $ECHO_N "checking whether the target supports hidden visibility... $ECHO_C" >&6 +if test "${have_attribute_visibility+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +void __attribute__((visibility("hidden"))) foo(void) { } +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + have_attribute_visibility=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +have_attribute_visibility=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" +fi +echo "$as_me:$LINENO: result: $have_attribute_visibility" >&5 +echo "${ECHO_T}$have_attribute_visibility" >&6 + if test $have_attribute_visibility = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ATTRIBUTE_VISIBILITY 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking whether the target supports dllexport" >&5 +echo $ECHO_N "checking whether the target supports dllexport... $ECHO_C" >&6 +if test "${have_attribute_dllexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +void __attribute__((dllexport)) foo(void) { } +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + have_attribute_dllexport=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +have_attribute_dllexport=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" +fi +echo "$as_me:$LINENO: result: $have_attribute_dllexport" >&5 +echo "${ECHO_T}$have_attribute_dllexport" >&6 + if test $have_attribute_dllexport = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ATTRIBUTE_DLLEXPORT 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking whether the target supports symbol aliases" >&5 +echo $ECHO_N "checking whether the target supports symbol aliases... $ECHO_C" >&6 +if test "${have_attribute_alias+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define ULP STR1(__USER_LABEL_PREFIX__) +#define STR1(x) STR2(x) +#define STR2(x) #x +void foo(void) { } +extern void bar(void) __attribute__((alias(ULP "foo"))); +int +main () +{ +bar(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + have_attribute_alias=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +have_attribute_alias=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $have_attribute_alias" >&5 +echo "${ECHO_T}$have_attribute_alias" >&6 + if test $have_attribute_alias = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ATTRIBUTE_ALIAS 1 +_ACEOF + + fi + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 6fd3f50..ab55097 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -234,6 +234,11 @@ LIBGFOR_GETTIMEOFDAY # have C99 integer types at all. LIBGFOR_TARGET_ILP32 +# Check out attribute support. +LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY +LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT +LIBGFOR_CHECK_ATTRIBUTE_ALIAS + AC_CACHE_SAVE if test ${multilib} = yes; then diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c index 5a517c1..3c81520 100644 --- a/libgfortran/generated/all_l4.c +++ b/libgfortran/generated/all_l4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __all_l4 (gfc_array_l4 *, gfc_array_l4 *, index_type *); +export_proto_np(__all_l4); + void -__all_l4 (gfc_array_l4 * retarray, gfc_array_l4 *array, index_type *pdim) +__all_l4 (gfc_array_l4 *retarray, gfc_array_l4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c index a583963..c7a8df0 100644 --- a/libgfortran/generated/all_l8.c +++ b/libgfortran/generated/all_l8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __all_l8 (gfc_array_l8 *, gfc_array_l8 *, index_type *); +export_proto_np(__all_l8); + void -__all_l8 (gfc_array_l8 * retarray, gfc_array_l8 *array, index_type *pdim) +__all_l8 (gfc_array_l8 *retarray, gfc_array_l8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c index 93beea7..da3f2b7 100644 --- a/libgfortran/generated/any_l4.c +++ b/libgfortran/generated/any_l4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __any_l4 (gfc_array_l4 *, gfc_array_l4 *, index_type *); +export_proto_np(__any_l4); + void -__any_l4 (gfc_array_l4 * retarray, gfc_array_l4 *array, index_type *pdim) +__any_l4 (gfc_array_l4 *retarray, gfc_array_l4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c index bc0ede8..8258db9 100644 --- a/libgfortran/generated/any_l8.c +++ b/libgfortran/generated/any_l8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __any_l8 (gfc_array_l8 *, gfc_array_l8 *, index_type *); +export_proto_np(__any_l8); + void -__any_l8 (gfc_array_l8 * retarray, gfc_array_l8 *array, index_type *pdim) +__any_l8 (gfc_array_l8 *retarray, gfc_array_l8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/count_4_l4.c b/libgfortran/generated/count_4_l4.c index 9c33c2e..0e3e298 100644 --- a/libgfortran/generated/count_4_l4.c +++ b/libgfortran/generated/count_4_l4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __count_4_l4 (gfc_array_i4 *, gfc_array_l4 *, index_type *); +export_proto_np(__count_4_l4); + void -__count_4_l4 (gfc_array_i4 * retarray, gfc_array_l4 *array, index_type *pdim) +__count_4_l4 (gfc_array_i4 *retarray, gfc_array_l4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/count_4_l8.c b/libgfortran/generated/count_4_l8.c index 288aa3a..7e9a376 100644 --- a/libgfortran/generated/count_4_l8.c +++ b/libgfortran/generated/count_4_l8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __count_4_l8 (gfc_array_i4 *, gfc_array_l8 *, index_type *); +export_proto_np(__count_4_l8); + void -__count_4_l8 (gfc_array_i4 * retarray, gfc_array_l8 *array, index_type *pdim) +__count_4_l8 (gfc_array_i4 *retarray, gfc_array_l8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/count_8_l4.c b/libgfortran/generated/count_8_l4.c index bf83d3e..c23895b 100644 --- a/libgfortran/generated/count_8_l4.c +++ b/libgfortran/generated/count_8_l4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __count_8_l4 (gfc_array_i8 *, gfc_array_l4 *, index_type *); +export_proto_np(__count_8_l4); + void -__count_8_l4 (gfc_array_i8 * retarray, gfc_array_l4 *array, index_type *pdim) +__count_8_l4 (gfc_array_i8 *retarray, gfc_array_l4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/count_8_l8.c b/libgfortran/generated/count_8_l8.c index ef05c6d..1535af4 100644 --- a/libgfortran/generated/count_8_l8.c +++ b/libgfortran/generated/count_8_l8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __count_8_l8 (gfc_array_i8 *, gfc_array_l8 *, index_type *); +export_proto_np(__count_8_l8); + void -__count_8_l8 (gfc_array_i8 * retarray, gfc_array_l8 *array, index_type *pdim) +__count_8_l8 (gfc_array_i8 *retarray, gfc_array_l8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c index 9375074..9293eae 100644 --- a/libgfortran/generated/cshift1_4.c +++ b/libgfortran/generated/cshift1_4.c @@ -25,9 +25,15 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +void __cshift1_4 (const gfc_array_char * ret, + const gfc_array_char * array, + const gfc_array_i4 * h, const GFC_INTEGER_4 * pwhich); +export_proto_np(__cshift1_4); + void -__cshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, - const gfc_array_i4 * h, const GFC_INTEGER_4 * pwhich) +__cshift1_4 (const gfc_array_char * ret, + const gfc_array_char * array, + const gfc_array_i4 * h, const GFC_INTEGER_4 * pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -41,7 +47,7 @@ __cshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, index_type soffset; const char *sptr; const char *src; - /* h.* indicates the shift array. */ + /* h.* indicates the array. */ index_type hstride[GFC_MAX_DIMENSIONS - 1]; index_type hstride0; const GFC_INTEGER_4 *hptr; @@ -70,7 +76,7 @@ __cshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, size = GFC_DESCRIPTOR_SIZE (array); n = 0; -/* Initialized for avoiding compiler warnings. */ + /* Initialized for avoiding compiler warnings. */ roffset = size; soffset = size; len = 0; @@ -115,7 +121,7 @@ __cshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, while (rptr) { - /* Do the shift for this dimension. */ + /* Do the for this dimension. */ sh = *hptr; sh = (div (sh, len)).rem; if (sh < 0) @@ -167,4 +173,3 @@ __cshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, } } } - diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c index 7303d56..803984f 100644 --- a/libgfortran/generated/cshift1_8.c +++ b/libgfortran/generated/cshift1_8.c @@ -25,9 +25,15 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +void __cshift1_8 (const gfc_array_char * ret, + const gfc_array_char * array, + const gfc_array_i8 * h, const GFC_INTEGER_8 * pwhich); +export_proto_np(__cshift1_8); + void -__cshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, - const gfc_array_i8 * h, const GFC_INTEGER_8 * pwhich) +__cshift1_8 (const gfc_array_char * ret, + const gfc_array_char * array, + const gfc_array_i8 * h, const GFC_INTEGER_8 * pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -41,7 +47,7 @@ __cshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, index_type soffset; const char *sptr; const char *src; - /* h.* indicates the shift array. */ + /* h.* indicates the array. */ index_type hstride[GFC_MAX_DIMENSIONS - 1]; index_type hstride0; const GFC_INTEGER_8 *hptr; @@ -70,7 +76,7 @@ __cshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, size = GFC_DESCRIPTOR_SIZE (array); n = 0; -/* Initialized for avoiding compiler warnings. */ + /* Initialized for avoiding compiler warnings. */ roffset = size; soffset = size; len = 0; @@ -115,7 +121,7 @@ __cshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, while (rptr) { - /* Do the shift for this dimension. */ + /* Do the for this dimension. */ sh = *hptr; sh = (div (sh, len)).rem; if (sh < 0) @@ -167,4 +173,3 @@ __cshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, } } } - diff --git a/libgfortran/generated/dotprod_c4.c b/libgfortran/generated/dotprod_c4.c index 9812ab4..ff60a23 100644 --- a/libgfortran/generated/dotprod_c4.c +++ b/libgfortran/generated/dotprod_c4.c @@ -27,6 +27,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_COMPLEX_4 __dot_product_c4 (gfc_array_c4 * a, gfc_array_c4 * b); +export_proto_np(__dot_product_c4); + /* Both parameters will already have been converted to the result type. */ GFC_COMPLEX_4 __dot_product_c4 (gfc_array_c4 * a, gfc_array_c4 * b) @@ -64,4 +67,3 @@ __dot_product_c4 (gfc_array_c4 * a, gfc_array_c4 * b) return res; } - diff --git a/libgfortran/generated/dotprod_c8.c b/libgfortran/generated/dotprod_c8.c index fde1802..cf22c37 100644 --- a/libgfortran/generated/dotprod_c8.c +++ b/libgfortran/generated/dotprod_c8.c @@ -27,6 +27,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_COMPLEX_8 __dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b); +export_proto_np(__dot_product_c8); + /* Both parameters will already have been converted to the result type. */ GFC_COMPLEX_8 __dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b) @@ -64,4 +67,3 @@ __dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b) return res; } - diff --git a/libgfortran/generated/dotprod_i4.c b/libgfortran/generated/dotprod_i4.c index 374d925..c0d6726 100644 --- a/libgfortran/generated/dotprod_i4.c +++ b/libgfortran/generated/dotprod_i4.c @@ -26,6 +26,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_INTEGER_4 __dot_product_i4 (gfc_array_i4 * a, gfc_array_i4 * b); +export_proto_np(__dot_product_i4); + /* Both parameters will already have been converted to the result type. */ GFC_INTEGER_4 __dot_product_i4 (gfc_array_i4 * a, gfc_array_i4 * b) @@ -61,4 +64,3 @@ __dot_product_i4 (gfc_array_i4 * a, gfc_array_i4 * b) return res; } - diff --git a/libgfortran/generated/dotprod_i8.c b/libgfortran/generated/dotprod_i8.c index 6702a1d..5722431 100644 --- a/libgfortran/generated/dotprod_i8.c +++ b/libgfortran/generated/dotprod_i8.c @@ -26,6 +26,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_INTEGER_8 __dot_product_i8 (gfc_array_i8 * a, gfc_array_i8 * b); +export_proto_np(__dot_product_i8); + /* Both parameters will already have been converted to the result type. */ GFC_INTEGER_8 __dot_product_i8 (gfc_array_i8 * a, gfc_array_i8 * b) @@ -61,4 +64,3 @@ __dot_product_i8 (gfc_array_i8 * a, gfc_array_i8 * b) return res; } - diff --git a/libgfortran/generated/dotprod_l4.c b/libgfortran/generated/dotprod_l4.c index 292c038..6248c9c 100644 --- a/libgfortran/generated/dotprod_l4.c +++ b/libgfortran/generated/dotprod_l4.c @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern GFC_LOGICAL_4 __dot_product_l4 (gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(__dot_product_l4); + GFC_LOGICAL_4 __dot_product_l4 (gfc_array_l4 * a, gfc_array_l4 * b) { @@ -71,4 +74,3 @@ __dot_product_l4 (gfc_array_l4 * a, gfc_array_l4 * b) return 0; } - diff --git a/libgfortran/generated/dotprod_l8.c b/libgfortran/generated/dotprod_l8.c index 4316607..7086288 100644 --- a/libgfortran/generated/dotprod_l8.c +++ b/libgfortran/generated/dotprod_l8.c @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern GFC_LOGICAL_8 __dot_product_l8 (gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(__dot_product_l8); + GFC_LOGICAL_8 __dot_product_l8 (gfc_array_l4 * a, gfc_array_l4 * b) { @@ -71,4 +74,3 @@ __dot_product_l8 (gfc_array_l4 * a, gfc_array_l4 * b) return 0; } - diff --git a/libgfortran/generated/dotprod_r4.c b/libgfortran/generated/dotprod_r4.c index 1edfea3..801e43e 100644 --- a/libgfortran/generated/dotprod_r4.c +++ b/libgfortran/generated/dotprod_r4.c @@ -26,6 +26,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_REAL_4 __dot_product_r4 (gfc_array_r4 * a, gfc_array_r4 * b); +export_proto_np(__dot_product_r4); + /* Both parameters will already have been converted to the result type. */ GFC_REAL_4 __dot_product_r4 (gfc_array_r4 * a, gfc_array_r4 * b) @@ -61,4 +64,3 @@ __dot_product_r4 (gfc_array_r4 * a, gfc_array_r4 * b) return res; } - diff --git a/libgfortran/generated/dotprod_r8.c b/libgfortran/generated/dotprod_r8.c index bf35710..edde2b2 100644 --- a/libgfortran/generated/dotprod_r8.c +++ b/libgfortran/generated/dotprod_r8.c @@ -26,6 +26,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern GFC_REAL_8 __dot_product_r8 (gfc_array_r8 * a, gfc_array_r8 * b); +export_proto_np(__dot_product_r8); + /* Both parameters will already have been converted to the result type. */ GFC_REAL_8 __dot_product_r8 (gfc_array_r8 * a, gfc_array_r8 * b) @@ -61,4 +64,3 @@ __dot_product_r8 (gfc_array_r8 * a, gfc_array_r8 * b) return res; } - diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c index 05b1af6..aaccb54 100644 --- a/libgfortran/generated/eoshift1_4.c +++ b/libgfortran/generated/eoshift1_4.c @@ -28,9 +28,17 @@ Boston, MA 02111-1307, USA. */ static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift1_4 (const gfc_array_char *, + const gfc_array_char *, + const gfc_array_i4 *, const char *, + const GFC_INTEGER_4 *); +export_proto_np(__eoshift1_4); + void -__eoshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, - const gfc_array_i4 * h, const char * pbound, const GFC_INTEGER_4 * pwhich) +__eoshift1_4 (const gfc_array_char *ret, + const gfc_array_char *array, + const gfc_array_i4 *h, const char *pbound, + const GFC_INTEGER_4 *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -175,4 +183,3 @@ __eoshift1_4 (const gfc_array_char * ret, const gfc_array_char * array, } } } - diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c index f74c022..3f37eb8 100644 --- a/libgfortran/generated/eoshift1_8.c +++ b/libgfortran/generated/eoshift1_8.c @@ -28,9 +28,17 @@ Boston, MA 02111-1307, USA. */ static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift1_8 (const gfc_array_char *, + const gfc_array_char *, + const gfc_array_i8 *, const char *, + const GFC_INTEGER_8 *); +export_proto_np(__eoshift1_8); + void -__eoshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, - const gfc_array_i8 * h, const char * pbound, const GFC_INTEGER_8 * pwhich) +__eoshift1_8 (const gfc_array_char *ret, + const gfc_array_char *array, + const gfc_array_i8 *h, const char *pbound, + const GFC_INTEGER_8 *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -175,4 +183,3 @@ __eoshift1_8 (const gfc_array_char * ret, const gfc_array_char * array, } } } - diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c index 07c2d9e..7609b2e 100644 --- a/libgfortran/generated/eoshift3_4.c +++ b/libgfortran/generated/eoshift3_4.c @@ -28,9 +28,15 @@ Boston, MA 02111-1307, USA. */ static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift3_4 (gfc_array_char *, gfc_array_char *, + gfc_array_i4 *, const gfc_array_char *, + GFC_INTEGER_4 *); +export_proto_np(__eoshift3_4); + void -__eoshift3_4 (gfc_array_char * ret, gfc_array_char * array, - gfc_array_i4 * h, const gfc_array_char * bound, GFC_INTEGER_4 * pwhich) +__eoshift3_4 (gfc_array_char *ret, gfc_array_char *array, + gfc_array_i4 *h, const gfc_array_char *bound, + GFC_INTEGER_4 *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -190,4 +196,3 @@ __eoshift3_4 (gfc_array_char * ret, gfc_array_char * array, } } } - diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c index fcb161d..3274bce 100644 --- a/libgfortran/generated/eoshift3_8.c +++ b/libgfortran/generated/eoshift3_8.c @@ -28,9 +28,15 @@ Boston, MA 02111-1307, USA. */ static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift3_8 (gfc_array_char *, gfc_array_char *, + gfc_array_i8 *, const gfc_array_char *, + GFC_INTEGER_8 *); +export_proto_np(__eoshift3_8); + void -__eoshift3_8 (gfc_array_char * ret, gfc_array_char * array, - gfc_array_i8 * h, const gfc_array_char * bound, GFC_INTEGER_8 * pwhich) +__eoshift3_8 (gfc_array_char *ret, gfc_array_char *array, + gfc_array_i8 *h, const gfc_array_char *bound, + GFC_INTEGER_8 *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -190,4 +196,3 @@ __eoshift3_8 (gfc_array_char * ret, gfc_array_char * array, } } } - diff --git a/libgfortran/generated/exponent_r4.c b/libgfortran/generated/exponent_r4.c index 34e76b6..70c376c 100644 --- a/libgfortran/generated/exponent_r4.c +++ b/libgfortran/generated/exponent_r4.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_INTEGER_4 exponent_r4 (GFC_REAL_4 s); +export_proto(exponent_r4); + GFC_INTEGER_4 -prefix(exponent_r4) (GFC_REAL_4 s) +exponent_r4 (GFC_REAL_4 s) { int ret; frexpf (s, &ret); diff --git a/libgfortran/generated/exponent_r8.c b/libgfortran/generated/exponent_r8.c index 8a4101e..9d54920 100644 --- a/libgfortran/generated/exponent_r8.c +++ b/libgfortran/generated/exponent_r8.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_INTEGER_4 exponent_r8 (GFC_REAL_8 s); +export_proto(exponent_r8); + GFC_INTEGER_4 -prefix(exponent_r8) (GFC_REAL_8 s) +exponent_r8 (GFC_REAL_8 s) { int ret; frexp (s, &ret); diff --git a/libgfortran/generated/fraction_r4.c b/libgfortran/generated/fraction_r4.c index a86e829..273239a 100644 --- a/libgfortran/generated/fraction_r4.c +++ b/libgfortran/generated/fraction_r4.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_4 fraction_r4 (GFC_REAL_4 s); +export_proto(fraction_r4); + GFC_REAL_4 -prefix(fraction_r4) (GFC_REAL_4 s) +fraction_r4 (GFC_REAL_4 s) { int dummy_exp; return frexpf (s, &dummy_exp); diff --git a/libgfortran/generated/fraction_r8.c b/libgfortran/generated/fraction_r8.c index 613c6ac..b7600bf 100644 --- a/libgfortran/generated/fraction_r8.c +++ b/libgfortran/generated/fraction_r8.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_8 fraction_r8 (GFC_REAL_8 s); +export_proto(fraction_r8); + GFC_REAL_8 -prefix(fraction_r8) (GFC_REAL_8 s) +fraction_r8 (GFC_REAL_8 s) { int dummy_exp; return frexp (s, &dummy_exp); diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c index 19e4f23..a05a321 100644 --- a/libgfortran/generated/matmul_c4.c +++ b/libgfortran/generated/matmul_c4.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * b); +export_proto_np(__matmul_c4); + void __matmul_c4 (gfc_array_c4 * retarray, gfc_array_c4 * a, gfc_array_c4 * b) { diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c index fb422cb..42833b9 100644 --- a/libgfortran/generated/matmul_c8.c +++ b/libgfortran/generated/matmul_c8.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * b); +export_proto_np(__matmul_c8); + void __matmul_c8 (gfc_array_c8 * retarray, gfc_array_c8 * a, gfc_array_c8 * b) { diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c index e5f534a..de8a919 100644 --- a/libgfortran/generated/matmul_i4.c +++ b/libgfortran/generated/matmul_i4.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * b); +export_proto_np(__matmul_i4); + void __matmul_i4 (gfc_array_i4 * retarray, gfc_array_i4 * a, gfc_array_i4 * b) { diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c index 88bbf7a..b4831e2 100644 --- a/libgfortran/generated/matmul_i8.c +++ b/libgfortran/generated/matmul_i8.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b); +export_proto_np(__matmul_i8); + void __matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b) { diff --git a/libgfortran/generated/matmul_l4.c b/libgfortran/generated/matmul_l4.c index 1af2eb0..491392b 100644 --- a/libgfortran/generated/matmul_l4.c +++ b/libgfortran/generated/matmul_l4.c @@ -26,6 +26,10 @@ Boston, MA 02111-1307, USA. */ /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ + +extern void __matmul_l4 (gfc_array_l4 *, gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(__matmul_l4); + void __matmul_l4 (gfc_array_l4 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) { diff --git a/libgfortran/generated/matmul_l8.c b/libgfortran/generated/matmul_l8.c index d6d85a1..2a479e7 100644 --- a/libgfortran/generated/matmul_l8.c +++ b/libgfortran/generated/matmul_l8.c @@ -26,6 +26,10 @@ Boston, MA 02111-1307, USA. */ /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ + +extern void __matmul_l8 (gfc_array_l8 *, gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(__matmul_l8); + void __matmul_l8 (gfc_array_l8 * retarray, gfc_array_l4 * a, gfc_array_l4 * b) { diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c index 91417cc..b12a8a4 100644 --- a/libgfortran/generated/matmul_r4.c +++ b/libgfortran/generated/matmul_r4.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * b); +export_proto_np(__matmul_r4); + void __matmul_r4 (gfc_array_r4 * retarray, gfc_array_r4 * a, gfc_array_r4 * b) { diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c index 2fc3fed..b0c45c0 100644 --- a/libgfortran/generated/matmul_r8.c +++ b/libgfortran/generated/matmul_r8.c @@ -37,6 +37,9 @@ Boston, MA 02111-1307, USA. */ C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void __matmul_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * b); +export_proto_np(__matmul_r8); + void __matmul_r8 (gfc_array_r8 * retarray, gfc_array_r8 * a, gfc_array_r8 * b) { diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c index b55da1f..aa7d428 100644 --- a/libgfortran/generated/maxloc0_4_i4.c +++ b/libgfortran/generated/maxloc0_4_i4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array); +export_proto_np(__maxloc0_4_i4); + void __maxloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array) { @@ -117,6 +121,10 @@ __maxloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array) } } + +extern void __mmaxloc0_4_i4 (gfc_array_i4 *, gfc_array_i4 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_4_i4); + void __mmaxloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c index 36c0ef5..100910e 100644 --- a/libgfortran/generated/maxloc0_4_i8.c +++ b/libgfortran/generated/maxloc0_4_i8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array); +export_proto_np(__maxloc0_4_i8); + void __maxloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array) { @@ -117,6 +121,10 @@ __maxloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array) } } + +extern void __mmaxloc0_4_i8 (gfc_array_i4 *, gfc_array_i8 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_4_i8); + void __mmaxloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c index 40f58cc..0b75c05 100644 --- a/libgfortran/generated/maxloc0_4_r4.c +++ b/libgfortran/generated/maxloc0_4_r4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array); +export_proto_np(__maxloc0_4_r4); + void __maxloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array) { @@ -117,6 +121,10 @@ __maxloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array) } } + +extern void __mmaxloc0_4_r4 (gfc_array_i4 *, gfc_array_r4 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_4_r4); + void __mmaxloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c index ebb6020..1463d80 100644 --- a/libgfortran/generated/maxloc0_4_r8.c +++ b/libgfortran/generated/maxloc0_4_r8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array); +export_proto_np(__maxloc0_4_r8); + void __maxloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array) { @@ -117,6 +121,10 @@ __maxloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array) } } + +extern void __mmaxloc0_4_r8 (gfc_array_i4 *, gfc_array_r8 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_4_r8); + void __mmaxloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c index 335a329..822ddd0 100644 --- a/libgfortran/generated/maxloc0_8_i4.c +++ b/libgfortran/generated/maxloc0_8_i4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array); +export_proto_np(__maxloc0_8_i4); + void __maxloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array) { @@ -117,6 +121,10 @@ __maxloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array) } } + +extern void __mmaxloc0_8_i4 (gfc_array_i8 *, gfc_array_i4 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_8_i4); + void __mmaxloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c index 5bee14a..8a4ed81 100644 --- a/libgfortran/generated/maxloc0_8_i8.c +++ b/libgfortran/generated/maxloc0_8_i8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array); +export_proto_np(__maxloc0_8_i8); + void __maxloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array) { @@ -117,6 +121,10 @@ __maxloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array) } } + +extern void __mmaxloc0_8_i8 (gfc_array_i8 *, gfc_array_i8 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_8_i8); + void __mmaxloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c index 7839e51..73a3e2d 100644 --- a/libgfortran/generated/maxloc0_8_r4.c +++ b/libgfortran/generated/maxloc0_8_r4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array); +export_proto_np(__maxloc0_8_r4); + void __maxloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array) { @@ -117,6 +121,10 @@ __maxloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array) } } + +extern void __mmaxloc0_8_r4 (gfc_array_i8 *, gfc_array_r4 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_8_r4); + void __mmaxloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c index 088d89c..cc3e8d5 100644 --- a/libgfortran/generated/maxloc0_8_r8.c +++ b/libgfortran/generated/maxloc0_8_r8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __maxloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array); +export_proto_np(__maxloc0_8_r8); + void __maxloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array) { @@ -117,6 +121,10 @@ __maxloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array) } } + +extern void __mmaxloc0_8_r8 (gfc_array_i8 *, gfc_array_r8 *, gfc_array_l4 *); +export_proto_np(__mmaxloc0_8_r8); + void __mmaxloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c index 2369e77..7905c01 100644 --- a/libgfortran/generated/maxloc1_4_i4.c +++ b/libgfortran/generated/maxloc1_4_i4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_4_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__maxloc1_4_i4); + void -__maxloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__maxloc1_4_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mmaxloc1_4_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_4_i4); + void __mmaxloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c index 36860c2..a08cb03 100644 --- a/libgfortran/generated/maxloc1_4_i8.c +++ b/libgfortran/generated/maxloc1_4_i8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_4_i8 (gfc_array_i4 *, gfc_array_i8 *, index_type *); +export_proto_np(__maxloc1_4_i8); + void -__maxloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) +__maxloc1_4_i8 (gfc_array_i4 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mmaxloc1_4_i8 (gfc_array_i4 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_4_i8); + void __mmaxloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index 6d550d5..5c5c3af 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_4_r4 (gfc_array_i4 *, gfc_array_r4 *, index_type *); +export_proto_np(__maxloc1_4_r4); + void -__maxloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) +__maxloc1_4_r4 (gfc_array_i4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mmaxloc1_4_r4 (gfc_array_i4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_4_r4); + void __mmaxloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c index 07a9eca..665c5b5 100644 --- a/libgfortran/generated/maxloc1_4_r8.c +++ b/libgfortran/generated/maxloc1_4_r8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_4_r8 (gfc_array_i4 *, gfc_array_r8 *, index_type *); +export_proto_np(__maxloc1_4_r8); + void -__maxloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) +__maxloc1_4_r8 (gfc_array_i4 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mmaxloc1_4_r8 (gfc_array_i4 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_4_r8); + void __mmaxloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c index 7914259..dc11e70 100644 --- a/libgfortran/generated/maxloc1_8_i4.c +++ b/libgfortran/generated/maxloc1_8_i4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_8_i4 (gfc_array_i8 *, gfc_array_i4 *, index_type *); +export_proto_np(__maxloc1_8_i4); + void -__maxloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) +__maxloc1_8_i4 (gfc_array_i8 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mmaxloc1_8_i4 (gfc_array_i8 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_8_i4); + void __mmaxloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c index 46a7561..68dd21f 100644 --- a/libgfortran/generated/maxloc1_8_i8.c +++ b/libgfortran/generated/maxloc1_8_i8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_8_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__maxloc1_8_i8); + void -__maxloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__maxloc1_8_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mmaxloc1_8_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_8_i8); + void __mmaxloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c index 1ab1be8..adeac9a 100644 --- a/libgfortran/generated/maxloc1_8_r4.c +++ b/libgfortran/generated/maxloc1_8_r4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_8_r4 (gfc_array_i8 *, gfc_array_r4 *, index_type *); +export_proto_np(__maxloc1_8_r4); + void -__maxloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) +__maxloc1_8_r4 (gfc_array_i8 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mmaxloc1_8_r4 (gfc_array_i8 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_8_r4); + void __mmaxloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c index b221baa..82e754c 100644 --- a/libgfortran/generated/maxloc1_8_r8.c +++ b/libgfortran/generated/maxloc1_8_r8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __maxloc1_8_r8 (gfc_array_i8 *, gfc_array_r8 *, index_type *); +export_proto_np(__maxloc1_8_r8); + void -__maxloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) +__maxloc1_8_r8 (gfc_array_i8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __maxloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mmaxloc1_8_r8 (gfc_array_i8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxloc1_8_r8); + void __mmaxloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c index 8d37dfe..f24735c 100644 --- a/libgfortran/generated/maxval_i4.c +++ b/libgfortran/generated/maxval_i4.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __maxval_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__maxval_i4); + void -__maxval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__maxval_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __maxval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mmaxval_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxval_i4); + void __mmaxval_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c index bdb33c9..e9ef4ec 100644 --- a/libgfortran/generated/maxval_i8.c +++ b/libgfortran/generated/maxval_i8.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __maxval_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__maxval_i8); + void -__maxval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__maxval_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __maxval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mmaxval_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxval_i8); + void __mmaxval_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c index 78e83dc..7339490 100644 --- a/libgfortran/generated/maxval_r4.c +++ b/libgfortran/generated/maxval_r4.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __maxval_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *); +export_proto_np(__maxval_r4); + void -__maxval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) +__maxval_r4 (gfc_array_r4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __maxval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mmaxval_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxval_r4); + void __mmaxval_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c index e3c7453..cbc1fc9 100644 --- a/libgfortran/generated/maxval_r8.c +++ b/libgfortran/generated/maxval_r8.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __maxval_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *); +export_proto_np(__maxval_r8); + void -__maxval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) +__maxval_r8 (gfc_array_r8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __maxval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mmaxval_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mmaxval_r8); + void __mmaxval_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c index c12eea0..c377498 100644 --- a/libgfortran/generated/minloc0_4_i4.c +++ b/libgfortran/generated/minloc0_4_i4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array); +export_proto_np(__minloc0_4_i4); + void __minloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array) { @@ -117,6 +121,10 @@ __minloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array) } } + +extern void __mminloc0_4_i4 (gfc_array_i4 *, gfc_array_i4 *, gfc_array_l4 *); +export_proto_np(__mminloc0_4_i4); + void __mminloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c index 94842a3..56fd261 100644 --- a/libgfortran/generated/minloc0_4_i8.c +++ b/libgfortran/generated/minloc0_4_i8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array); +export_proto_np(__minloc0_4_i8); + void __minloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array) { @@ -117,6 +121,10 @@ __minloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array) } } + +extern void __mminloc0_4_i8 (gfc_array_i4 *, gfc_array_i8 *, gfc_array_l4 *); +export_proto_np(__mminloc0_4_i8); + void __mminloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c index 9ed52c3..30b5b1d 100644 --- a/libgfortran/generated/minloc0_4_r4.c +++ b/libgfortran/generated/minloc0_4_r4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array); +export_proto_np(__minloc0_4_r4); + void __minloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array) { @@ -117,6 +121,10 @@ __minloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array) } } + +extern void __mminloc0_4_r4 (gfc_array_i4 *, gfc_array_r4 *, gfc_array_l4 *); +export_proto_np(__mminloc0_4_r4); + void __mminloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c index 186b493..8a4267d 100644 --- a/libgfortran/generated/minloc0_4_r8.c +++ b/libgfortran/generated/minloc0_4_r8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array); +export_proto_np(__minloc0_4_r8); + void __minloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array) { @@ -117,6 +121,10 @@ __minloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array) } } + +extern void __mminloc0_4_r8 (gfc_array_i4 *, gfc_array_r8 *, gfc_array_l4 *); +export_proto_np(__mminloc0_4_r8); + void __mminloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c index 962ee83..6d7cb9c 100644 --- a/libgfortran/generated/minloc0_8_i4.c +++ b/libgfortran/generated/minloc0_8_i4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array); +export_proto_np(__minloc0_8_i4); + void __minloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array) { @@ -117,6 +121,10 @@ __minloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array) } } + +extern void __mminloc0_8_i4 (gfc_array_i8 *, gfc_array_i4 *, gfc_array_l4 *); +export_proto_np(__mminloc0_8_i4); + void __mminloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c index e13a428..87d6705 100644 --- a/libgfortran/generated/minloc0_8_i8.c +++ b/libgfortran/generated/minloc0_8_i8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array); +export_proto_np(__minloc0_8_i8); + void __minloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array) { @@ -117,6 +121,10 @@ __minloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array) } } + +extern void __mminloc0_8_i8 (gfc_array_i8 *, gfc_array_i8 *, gfc_array_l4 *); +export_proto_np(__mminloc0_8_i8); + void __mminloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c index cb9ade8..660a763 100644 --- a/libgfortran/generated/minloc0_8_r4.c +++ b/libgfortran/generated/minloc0_8_r4.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array); +export_proto_np(__minloc0_8_r4); + void __minloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array) { @@ -117,6 +121,10 @@ __minloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array) } } + +extern void __mminloc0_8_r4 (gfc_array_i8 *, gfc_array_r4 *, gfc_array_l4 *); +export_proto_np(__mminloc0_8_r4); + void __mminloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c index cf19f44..b8c8303 100644 --- a/libgfortran/generated/minloc0_8_r8.c +++ b/libgfortran/generated/minloc0_8_r8.c @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" + +extern void __minloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array); +export_proto_np(__minloc0_8_r8); + void __minloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array) { @@ -117,6 +121,10 @@ __minloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array) } } + +extern void __mminloc0_8_r8 (gfc_array_i8 *, gfc_array_r8 *, gfc_array_l4 *); +export_proto_np(__mminloc0_8_r8); + void __mminloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c index ce73916..eaf4212 100644 --- a/libgfortran/generated/minloc1_4_i4.c +++ b/libgfortran/generated/minloc1_4_i4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_4_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__minloc1_4_i4); + void -__minloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__minloc1_4_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mminloc1_4_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_4_i4); + void __mminloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c index 55a249b..0ea3802 100644 --- a/libgfortran/generated/minloc1_4_i8.c +++ b/libgfortran/generated/minloc1_4_i8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_4_i8 (gfc_array_i4 *, gfc_array_i8 *, index_type *); +export_proto_np(__minloc1_4_i8); + void -__minloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) +__minloc1_4_i8 (gfc_array_i4 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mminloc1_4_i8 (gfc_array_i4 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_4_i8); + void __mminloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c index 50adeb3..3336f0f 100644 --- a/libgfortran/generated/minloc1_4_r4.c +++ b/libgfortran/generated/minloc1_4_r4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_4_r4 (gfc_array_i4 *, gfc_array_r4 *, index_type *); +export_proto_np(__minloc1_4_r4); + void -__minloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) +__minloc1_4_r4 (gfc_array_i4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mminloc1_4_r4 (gfc_array_i4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_4_r4); + void __mminloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c index aafb578..bb59dcc 100644 --- a/libgfortran/generated/minloc1_4_r8.c +++ b/libgfortran/generated/minloc1_4_r8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_4_r8 (gfc_array_i4 *, gfc_array_r8 *, index_type *); +export_proto_np(__minloc1_4_r8); + void -__minloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) +__minloc1_4_r8 (gfc_array_i4 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mminloc1_4_r8 (gfc_array_i4 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_4_r8); + void __mminloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c index 5c347dd..c30f656 100644 --- a/libgfortran/generated/minloc1_8_i4.c +++ b/libgfortran/generated/minloc1_8_i4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_8_i4 (gfc_array_i8 *, gfc_array_i4 *, index_type *); +export_proto_np(__minloc1_8_i4); + void -__minloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) +__minloc1_8_i4 (gfc_array_i8 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mminloc1_8_i4 (gfc_array_i8 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_8_i4); + void __mminloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c index c8811f3..4d3e34a 100644 --- a/libgfortran/generated/minloc1_8_i8.c +++ b/libgfortran/generated/minloc1_8_i8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_8_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__minloc1_8_i8); + void -__minloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__minloc1_8_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mminloc1_8_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_8_i8); + void __mminloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c index 81ba167..e5c1a59 100644 --- a/libgfortran/generated/minloc1_8_r4.c +++ b/libgfortran/generated/minloc1_8_r4.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_8_r4 (gfc_array_i8 *, gfc_array_r4 *, index_type *); +export_proto_np(__minloc1_8_r4); + void -__minloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) +__minloc1_8_r4 (gfc_array_i8 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mminloc1_8_r4 (gfc_array_i8 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_8_r4); + void __mminloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c index 684eab2..ff7ebb9 100644 --- a/libgfortran/generated/minloc1_8_r8.c +++ b/libgfortran/generated/minloc1_8_r8.c @@ -26,8 +26,12 @@ Boston, MA 02111-1307, USA. */ #include <limits.h> #include "libgfortran.h" + +extern void __minloc1_8_r8 (gfc_array_i8 *, gfc_array_r8 *, index_type *); +export_proto_np(__minloc1_8_r8); + void -__minloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) +__minloc1_8_r8 (gfc_array_i8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -152,6 +156,11 @@ __minloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mminloc1_8_r8 (gfc_array_i8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminloc1_8_r8); + void __mminloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c index 7846452..23b8326 100644 --- a/libgfortran/generated/minval_i4.c +++ b/libgfortran/generated/minval_i4.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __minval_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__minval_i4); + void -__minval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__minval_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __minval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mminval_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminval_i4); + void __mminval_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c index deca048..149ba7a 100644 --- a/libgfortran/generated/minval_i8.c +++ b/libgfortran/generated/minval_i8.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __minval_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__minval_i8); + void -__minval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__minval_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __minval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mminval_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminval_i8); + void __mminval_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c index 8990d88..3a4b13d 100644 --- a/libgfortran/generated/minval_r4.c +++ b/libgfortran/generated/minval_r4.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __minval_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *); +export_proto_np(__minval_r4); + void -__minval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) +__minval_r4 (gfc_array_r4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __minval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mminval_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminval_r4); + void __mminval_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c index 285e90e..e30c431 100644 --- a/libgfortran/generated/minval_r8.c +++ b/libgfortran/generated/minval_r8.c @@ -25,8 +25,12 @@ Boston, MA 02111-1307, USA. */ #include <float.h> #include "libgfortran.h" + +extern void __minval_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *); +export_proto_np(__minval_r8); + void -__minval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) +__minval_r8 (gfc_array_r8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -146,6 +150,11 @@ __minval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mminval_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mminval_r8); + void __mminval_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/nearest_r4.c b/libgfortran/generated/nearest_r4.c index cafc02f..d92efab 100644 --- a/libgfortran/generated/nearest_r4.c +++ b/libgfortran/generated/nearest_r4.c @@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_4 nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir); +export_proto(nearest_r4); + GFC_REAL_4 -prefix(nearest_r4) (GFC_REAL_4 s, GFC_REAL_4 dir) +nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir) { dir = copysignf (__builtin_inff (), dir); if (FLT_EVAL_METHOD != 0) diff --git a/libgfortran/generated/nearest_r8.c b/libgfortran/generated/nearest_r8.c index 54a3745..7dd6838 100644 --- a/libgfortran/generated/nearest_r8.c +++ b/libgfortran/generated/nearest_r8.c @@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_8 nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir); +export_proto(nearest_r8); + GFC_REAL_8 -prefix(nearest_r8) (GFC_REAL_8 s, GFC_REAL_8 dir) +nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir) { dir = copysign (__builtin_inf (), dir); if (FLT_EVAL_METHOD != 0) diff --git a/libgfortran/generated/pow_c4_i4.c b/libgfortran/generated/pow_c4_i4.c index de0f6f6..8aa3bf5 100644 --- a/libgfortran/generated/pow_c4_i4.c +++ b/libgfortran/generated/pow_c4_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_COMPLEX_4 pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b); +export_proto(pow_c4_i4); + GFC_COMPLEX_4 -prefix(pow_c4_i4) (GFC_COMPLEX_4 a, GFC_INTEGER_4 b) +pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b) { GFC_COMPLEX_4 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_c4_i8.c b/libgfortran/generated/pow_c4_i8.c index 6606527..007c277 100644 --- a/libgfortran/generated/pow_c4_i8.c +++ b/libgfortran/generated/pow_c4_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_COMPLEX_4 pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b); +export_proto(pow_c4_i8); + GFC_COMPLEX_4 -prefix(pow_c4_i8) (GFC_COMPLEX_4 a, GFC_INTEGER_8 b) +pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b) { GFC_COMPLEX_4 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/pow_c8_i4.c b/libgfortran/generated/pow_c8_i4.c index 5efb874..d8bc9fa 100644 --- a/libgfortran/generated/pow_c8_i4.c +++ b/libgfortran/generated/pow_c8_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_COMPLEX_8 pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b); +export_proto(pow_c8_i4); + GFC_COMPLEX_8 -prefix(pow_c8_i4) (GFC_COMPLEX_8 a, GFC_INTEGER_4 b) +pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b) { GFC_COMPLEX_8 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_c8_i8.c b/libgfortran/generated/pow_c8_i8.c index 17026b3..f0e8b38 100644 --- a/libgfortran/generated/pow_c8_i8.c +++ b/libgfortran/generated/pow_c8_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_COMPLEX_8 pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b); +export_proto(pow_c8_i8); + GFC_COMPLEX_8 -prefix(pow_c8_i8) (GFC_COMPLEX_8 a, GFC_INTEGER_8 b) +pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b) { GFC_COMPLEX_8 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/pow_i4_i4.c b/libgfortran/generated/pow_i4_i4.c index 15a349c..9b2d153 100644 --- a/libgfortran/generated/pow_i4_i4.c +++ b/libgfortran/generated/pow_i4_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_INTEGER_4 pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b); +export_proto(pow_i4_i4); + GFC_INTEGER_4 -prefix(pow_i4_i4) (GFC_INTEGER_4 a, GFC_INTEGER_4 b) +pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b) { GFC_INTEGER_4 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_i4_i8.c b/libgfortran/generated/pow_i4_i8.c index 72e8837..a721a6b 100644 --- a/libgfortran/generated/pow_i4_i8.c +++ b/libgfortran/generated/pow_i4_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_INTEGER_4 pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b); +export_proto(pow_i4_i8); + GFC_INTEGER_4 -prefix(pow_i4_i8) (GFC_INTEGER_4 a, GFC_INTEGER_8 b) +pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b) { GFC_INTEGER_4 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/pow_i8_i4.c b/libgfortran/generated/pow_i8_i4.c index 7a900d7..5e0d452 100644 --- a/libgfortran/generated/pow_i8_i4.c +++ b/libgfortran/generated/pow_i8_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_INTEGER_8 pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b); +export_proto(pow_i8_i4); + GFC_INTEGER_8 -prefix(pow_i8_i4) (GFC_INTEGER_8 a, GFC_INTEGER_4 b) +pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b) { GFC_INTEGER_8 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_i8_i8.c b/libgfortran/generated/pow_i8_i8.c index 591536f..2269051 100644 --- a/libgfortran/generated/pow_i8_i8.c +++ b/libgfortran/generated/pow_i8_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_INTEGER_8 pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b); +export_proto(pow_i8_i8); + GFC_INTEGER_8 -prefix(pow_i8_i8) (GFC_INTEGER_8 a, GFC_INTEGER_8 b) +pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b) { GFC_INTEGER_8 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/pow_r4_i4.c b/libgfortran/generated/pow_r4_i4.c index ffb8df7..51524fe 100644 --- a/libgfortran/generated/pow_r4_i4.c +++ b/libgfortran/generated/pow_r4_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_REAL_4 pow_r4_i4 (GFC_REAL_4 a, GFC_INTEGER_4 b); +export_proto(pow_r4_i4); + GFC_REAL_4 -prefix(pow_r4_i4) (GFC_REAL_4 a, GFC_INTEGER_4 b) +pow_r4_i4 (GFC_REAL_4 a, GFC_INTEGER_4 b) { GFC_REAL_4 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_r4_i8.c b/libgfortran/generated/pow_r4_i8.c index 1283882..2e0a71b 100644 --- a/libgfortran/generated/pow_r4_i8.c +++ b/libgfortran/generated/pow_r4_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_REAL_4 pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b); +export_proto(pow_r4_i8); + GFC_REAL_4 -prefix(pow_r4_i8) (GFC_REAL_4 a, GFC_INTEGER_8 b) +pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b) { GFC_REAL_4 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/pow_r8_i4.c b/libgfortran/generated/pow_r8_i4.c index fcead04..d07b571 100644 --- a/libgfortran/generated/pow_r8_i4.c +++ b/libgfortran/generated/pow_r8_i4.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_REAL_8 pow_r8_i4 (GFC_REAL_8 a, GFC_INTEGER_4 b); +export_proto(pow_r8_i4); + GFC_REAL_8 -prefix(pow_r8_i4) (GFC_REAL_8 a, GFC_INTEGER_4 b) +pow_r8_i4 (GFC_REAL_8 a, GFC_INTEGER_4 b) { GFC_REAL_8 pow, x; GFC_INTEGER_4 n, u; diff --git a/libgfortran/generated/pow_r8_i8.c b/libgfortran/generated/pow_r8_i8.c index 7f75c82..e922eef 100644 --- a/libgfortran/generated/pow_r8_i8.c +++ b/libgfortran/generated/pow_r8_i8.c @@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "libgfortran.h" -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +GFC_REAL_8 pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b); +export_proto(pow_r8_i8); + GFC_REAL_8 -prefix(pow_r8_i8) (GFC_REAL_8 a, GFC_INTEGER_8 b) +pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b) { GFC_REAL_8 pow, x; GFC_INTEGER_8 n, u; diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c index 0337ec6..f8fcdcb 100644 --- a/libgfortran/generated/product_c4.c +++ b/libgfortran/generated/product_c4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_c4 (gfc_array_c4 *, gfc_array_c4 *, index_type *); +export_proto_np(__product_c4); + void -__product_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) +__product_c4 (gfc_array_c4 *retarray, gfc_array_c4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) } } + +extern void __mproduct_c4 (gfc_array_c4 *, gfc_array_c4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_c4); + void __mproduct_c4 (gfc_array_c4 * retarray, gfc_array_c4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c index 22a26a8..4e54c68 100644 --- a/libgfortran/generated/product_c8.c +++ b/libgfortran/generated/product_c8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_c8 (gfc_array_c8 *, gfc_array_c8 *, index_type *); +export_proto_np(__product_c8); + void -__product_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) +__product_c8 (gfc_array_c8 *retarray, gfc_array_c8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) } } + +extern void __mproduct_c8 (gfc_array_c8 *, gfc_array_c8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_c8); + void __mproduct_c8 (gfc_array_c8 * retarray, gfc_array_c8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index c50c07f..386fbf9 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__product_i4); + void -__product_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__product_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __mproduct_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_i4); + void __mproduct_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c index 0f09a41..0e5ac66 100644 --- a/libgfortran/generated/product_i8.c +++ b/libgfortran/generated/product_i8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__product_i8); + void -__product_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__product_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __mproduct_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_i8); + void __mproduct_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c index f68a88a..cf38879 100644 --- a/libgfortran/generated/product_r4.c +++ b/libgfortran/generated/product_r4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *); +export_proto_np(__product_r4); + void -__product_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) +__product_r4 (gfc_array_r4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __mproduct_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_r4); + void __mproduct_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c index 0936d18..adba0bc 100644 --- a/libgfortran/generated/product_r8.c +++ b/libgfortran/generated/product_r8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __product_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *); +export_proto_np(__product_r8); + void -__product_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) +__product_r8 (gfc_array_r8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __product_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __mproduct_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__mproduct_r8); + void __mproduct_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c index 7da866c..70c3235 100644 --- a/libgfortran/generated/reshape_i4.c +++ b/libgfortran/generated/reshape_i4.c @@ -28,6 +28,11 @@ typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type; /* The shape parameter is ignored. We can currently deduce the shape from the return array. */ + +extern void __reshape_4 (gfc_array_i4 *, gfc_array_i4 *, shape_type *, + gfc_array_i4 *, shape_type *); +extern_proto_np(__reshape_4); + void __reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, gfc_array_i4 * pad, shape_type * order) @@ -222,4 +227,3 @@ __reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, } } } - diff --git a/libgfortran/generated/reshape_i8.c b/libgfortran/generated/reshape_i8.c index f4e4019..af76e25 100644 --- a/libgfortran/generated/reshape_i8.c +++ b/libgfortran/generated/reshape_i8.c @@ -28,6 +28,11 @@ typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type; /* The shape parameter is ignored. We can currently deduce the shape from the return array. */ + +extern void __reshape_8 (gfc_array_i8 *, gfc_array_i8 *, shape_type *, + gfc_array_i8 *, shape_type *); +extern_proto_np(__reshape_8); + void __reshape_8 (gfc_array_i8 * ret, gfc_array_i8 * source, shape_type * shape, gfc_array_i8 * pad, shape_type * order) @@ -222,4 +227,3 @@ __reshape_8 (gfc_array_i8 * ret, gfc_array_i8 * source, shape_type * shape, } } } - diff --git a/libgfortran/generated/set_exponent_r4.c b/libgfortran/generated/set_exponent_r4.c index 32717e2..9763ef6 100644 --- a/libgfortran/generated/set_exponent_r4.c +++ b/libgfortran/generated/set_exponent_r4.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_4 set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i); +export_proto(set_exponent_r4); + GFC_REAL_4 -prefix(set_exponent_r4) (GFC_REAL_4 s, GFC_INTEGER_4 i) +set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i) { int dummy_exp; return scalbnf (frexpf (s, &dummy_exp), i); diff --git a/libgfortran/generated/set_exponent_r8.c b/libgfortran/generated/set_exponent_r8.c index ad2a97d..91b0e71 100644 --- a/libgfortran/generated/set_exponent_r8.c +++ b/libgfortran/generated/set_exponent_r8.c @@ -22,8 +22,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" +extern GFC_REAL_8 set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i); +export_proto(set_exponent_r8); + GFC_REAL_8 -prefix(set_exponent_r8) (GFC_REAL_8 s, GFC_INTEGER_4 i) +set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i) { int dummy_exp; return scalbn (frexp (s, &dummy_exp), i); diff --git a/libgfortran/generated/shape_i4.c b/libgfortran/generated/shape_i4.c index 0344691..855ccc0 100644 --- a/libgfortran/generated/shape_i4.c +++ b/libgfortran/generated/shape_i4.c @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern void __shape_4 (gfc_array_i4 * ret, const gfc_array_i4 * array); +export_proto_np(__shape_4); + void __shape_4 (gfc_array_i4 * ret, const gfc_array_i4 * array) { @@ -40,4 +43,3 @@ __shape_4 (gfc_array_i4 * ret, const gfc_array_i4 * array) array->dim[n].ubound + 1 - array->dim[n].lbound; } } - diff --git a/libgfortran/generated/shape_i8.c b/libgfortran/generated/shape_i8.c index bd74900..0dc92f0 100644 --- a/libgfortran/generated/shape_i8.c +++ b/libgfortran/generated/shape_i8.c @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern void __shape_8 (gfc_array_i8 * ret, const gfc_array_i8 * array); +export_proto_np(__shape_8); + void __shape_8 (gfc_array_i8 * ret, const gfc_array_i8 * array) { @@ -40,4 +43,3 @@ __shape_8 (gfc_array_i8 * ret, const gfc_array_i8 * array) array->dim[n].ubound + 1 - array->dim[n].lbound; } } - diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c index 6507de8..a4af04a 100644 --- a/libgfortran/generated/sum_c4.c +++ b/libgfortran/generated/sum_c4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_c4 (gfc_array_c4 *, gfc_array_c4 *, index_type *); +export_proto_np(__sum_c4); + void -__sum_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) +__sum_c4 (gfc_array_c4 *retarray, gfc_array_c4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) } } + +extern void __msum_c4 (gfc_array_c4 *, gfc_array_c4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_c4); + void __msum_c4 (gfc_array_c4 * retarray, gfc_array_c4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c index bc2d045..f421e80 100644 --- a/libgfortran/generated/sum_c8.c +++ b/libgfortran/generated/sum_c8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_c8 (gfc_array_c8 *, gfc_array_c8 *, index_type *); +export_proto_np(__sum_c8); + void -__sum_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) +__sum_c8 (gfc_array_c8 *retarray, gfc_array_c8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) } } + +extern void __msum_c8 (gfc_array_c8 *, gfc_array_c8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_c8); + void __msum_c8 (gfc_array_c8 * retarray, gfc_array_c8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c index aac7f48..55b000d 100644 --- a/libgfortran/generated/sum_i4.c +++ b/libgfortran/generated/sum_i4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *); +export_proto_np(__sum_i4); + void -__sum_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) +__sum_i4 (gfc_array_i4 *retarray, gfc_array_i4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) } } + +extern void __msum_i4 (gfc_array_i4 *, gfc_array_i4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_i4); + void __msum_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index e9a539d..d72bd12 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *); +export_proto_np(__sum_i8); + void -__sum_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) +__sum_i8 (gfc_array_i8 *retarray, gfc_array_i8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) } } + +extern void __msum_i8 (gfc_array_i8 *, gfc_array_i8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_i8); + void __msum_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c index 11b5c49..dcb8155 100644 --- a/libgfortran/generated/sum_r4.c +++ b/libgfortran/generated/sum_r4.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *); +export_proto_np(__sum_r4); + void -__sum_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) +__sum_r4 (gfc_array_r4 *retarray, gfc_array_r4 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) } } + +extern void __msum_r4 (gfc_array_r4 *, gfc_array_r4 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_r4); + void __msum_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c index 95272fb..3a6ea96 100644 --- a/libgfortran/generated/sum_r8.c +++ b/libgfortran/generated/sum_r8.c @@ -24,8 +24,12 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" + +extern void __sum_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *); +export_proto_np(__sum_r8); + void -__sum_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) +__sum_r8 (gfc_array_r8 *retarray, gfc_array_r8 *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -144,6 +148,11 @@ __sum_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) } } + +extern void __msum_r8 (gfc_array_r8 *, gfc_array_r8 *, index_type *, + gfc_array_l4 *); +export_proto_np(__msum_r8); + void __msum_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array, index_type *pdim, gfc_array_l4 * mask) { diff --git a/libgfortran/generated/transpose_i4.c b/libgfortran/generated/transpose_i4.c index dad2987..24ae8a8 100644 --- a/libgfortran/generated/transpose_i4.c +++ b/libgfortran/generated/transpose_i4.c @@ -23,6 +23,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern void __transpose_4 (gfc_array_i4 * ret, gfc_array_i4 * source); +export_proto_np(__transpose_4); + void __transpose_4 (gfc_array_i4 * ret, gfc_array_i4 * source) { diff --git a/libgfortran/generated/transpose_i8.c b/libgfortran/generated/transpose_i8.c index 84811d0..67ef0dd 100644 --- a/libgfortran/generated/transpose_i8.c +++ b/libgfortran/generated/transpose_i8.c @@ -23,6 +23,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern void __transpose_8 (gfc_array_i8 * ret, gfc_array_i8 * source); +export_proto_np(__transpose_8); + void __transpose_8 (gfc_array_i8 * ret, gfc_array_i8 * source) { diff --git a/libgfortran/intrinsics/abort.c b/libgfortran/intrinsics/abort.c index cc2a422..8ab86ba 100644 --- a/libgfortran/intrinsics/abort.c +++ b/libgfortran/intrinsics/abort.c @@ -21,11 +21,10 @@ Boston, MA 02111-1307, USA. */ #include <stdlib.h> #include "libgfortran.h" +void PREFIX(abort) (void); +export_proto_np(PREFIX(abort)); -void prefix(abort) (void); - -void prefix(abort) () +void PREFIX(abort) (void) { abort (); } - diff --git a/libgfortran/intrinsics/args.c b/libgfortran/intrinsics/args.c index 984fa91..f674281 100644 --- a/libgfortran/intrinsics/args.c +++ b/libgfortran/intrinsics/args.c @@ -28,8 +28,11 @@ Boston, MA 02111-1307, USA. */ /* Get a commandline argument. */ +extern void getarg_i4 (GFC_INTEGER_4 *, char *, gfc_charlen_type); +iexport_proto(getarg_i4); + void -prefix(getarg_i4) (GFC_INTEGER_4 *pos, char *val, gfc_charlen_type val_len) +getarg_i4 (GFC_INTEGER_4 *pos, char *val, gfc_charlen_type val_len) { int argc; int arglen; @@ -50,24 +53,29 @@ prefix(getarg_i4) (GFC_INTEGER_4 *pos, char *val, gfc_charlen_type val_len) memcpy (val, argv[*pos], arglen); } } +iexport(getarg_i4); /* INTEGER*8 wrapper of getarg. */ +extern void getarg_i8 (GFC_INTEGER_8 *, char *, gfc_charlen_type); +export_proto (getarg_i8); + void -prefix(getarg_i8) (GFC_INTEGER_8 *pos, char *val, gfc_charlen_type val_len) +getarg_i8 (GFC_INTEGER_8 *pos, char *val, gfc_charlen_type val_len) { - GFC_INTEGER_4 pos4; - - pos4 = (GFC_INTEGER_4) *pos; - prefix(getarg_i4) (&pos4, val, val_len); + GFC_INTEGER_4 pos4 = (GFC_INTEGER_4) *pos; + getarg_i4 (&pos4, val, val_len); } /* Return the number of commandline arguments. */ +extern GFC_INTEGER_4 iargc (void); +export_proto(iargc); + GFC_INTEGER_4 -prefix(iargc) (void) +iargc (void) { int argc; char **argv; @@ -96,14 +104,16 @@ prefix(iargc) (void) #define GFC_GC_FAILURE 42 +extern void get_command_argument_i4 (GFC_INTEGER_4 *, char *, GFC_INTEGER_4 *, + GFC_INTEGER_4 *, gfc_charlen_type); +iexport_proto(get_command_argument_i4); + /* Get a single commandline argument. */ void -prefix(get_command_argument_i4) (GFC_INTEGER_4 *number, - char *value, - GFC_INTEGER_4 *length, - GFC_INTEGER_4 *status, - gfc_charlen_type value_len) +get_command_argument_i4 (GFC_INTEGER_4 *number, char *value, + GFC_INTEGER_4 *length, GFC_INTEGER_4 *status, + gfc_charlen_type value_len) { int argc, arglen = 0, stat_flag = GFC_GC_SUCCESS; char **argv; @@ -146,24 +156,26 @@ prefix(get_command_argument_i4) (GFC_INTEGER_4 *number, if (status != NULL) *status = stat_flag; } +iexport(get_command_argument_i4); /* INTEGER*8 wrapper for get_command_argument. */ +extern void get_command_argument_i8 (GFC_INTEGER_8 *, char *, GFC_INTEGER_8 *, + GFC_INTEGER_8 *, gfc_charlen_type); +export_proto(get_command_argument_i8); + void -prefix(get_command_argument_i8) (GFC_INTEGER_8 *number, - char *value, - GFC_INTEGER_8 *length, - GFC_INTEGER_8 *status, - gfc_charlen_type value_len) +get_command_argument_i8 (GFC_INTEGER_8 *number, char *value, + GFC_INTEGER_8 *length, GFC_INTEGER_8 *status, + gfc_charlen_type value_len) { GFC_INTEGER_4 number4; GFC_INTEGER_4 length4; GFC_INTEGER_4 status4; number4 = (GFC_INTEGER_4) *number; - prefix (get_command_argument_i4) (&number4, value, &length4, &status4, - value_len); + get_command_argument_i4 (&number4, value, &length4, &status4, value_len); if (length) *length = length4; if (status) @@ -173,11 +185,13 @@ prefix(get_command_argument_i8) (GFC_INTEGER_8 *number, /* Return the whole commandline. */ +extern void get_command_i4 (char *, GFC_INTEGER_4 *, GFC_INTEGER_4 *, + gfc_charlen_type); +iexport_proto(get_command_i4); + void -prefix(get_command_i4) (char *command, - GFC_INTEGER_4 *length, - GFC_INTEGER_4 *status, - gfc_charlen_type command_len) +get_command_i4 (char *command, GFC_INTEGER_4 *length, GFC_INTEGER_4 *status, + gfc_charlen_type command_len) { int i, argc, arglen, thisarg; int stat_flag = GFC_GC_SUCCESS; @@ -229,20 +243,23 @@ prefix(get_command_i4) (char *command, if (status != NULL) *status = stat_flag; } +iexport(get_command_i4); /* INTEGER*8 wrapper for get_command. */ +extern void get_command_i8 (char *, GFC_INTEGER_8 *, GFC_INTEGER_8 *, + gfc_charlen_type); +export_proto(get_command_i8); + void -prefix(get_command_i8) (char *command, - GFC_INTEGER_8 *length, - GFC_INTEGER_8 *status, - gfc_charlen_type command_len) +get_command_i8 (char *command, GFC_INTEGER_8 *length, GFC_INTEGER_8 *status, + gfc_charlen_type command_len) { GFC_INTEGER_4 length4; GFC_INTEGER_4 status4; - prefix (get_command_i4) (command, &length4, &status4, command_len); + get_command_i4 (command, &length4, &status4, command_len); if (length) *length = length4; if (status) diff --git a/libgfortran/intrinsics/associated.c b/libgfortran/intrinsics/associated.c index e7805f1..012ffc1 100644 --- a/libgfortran/intrinsics/associated.c +++ b/libgfortran/intrinsics/associated.c @@ -21,8 +21,9 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" -#define associated prefix(associated) - +extern GFC_LOGICAL_4 associated (const gfc_array_void *, + const gfc_array_void *); +export_proto(associated); GFC_LOGICAL_4 associated (const gfc_array_void *pointer, const gfc_array_void *target) diff --git a/libgfortran/intrinsics/cpu_time.c b/libgfortran/intrinsics/cpu_time.c index 887debc..58f2253 100644 --- a/libgfortran/intrinsics/cpu_time.c +++ b/libgfortran/intrinsics/cpu_time.c @@ -101,29 +101,43 @@ __cpu_time_1 (long *sec, long *usec) #endif /* HAVE_GETRUSAGE */ } -#undef CPU_TIME -#define CPU_TIME(KIND) \ -void prefix(cpu_time_##KIND) (GFC_REAL_##KIND *__time) \ -{ \ - long sec, usec; \ - __cpu_time_1 (&sec, &usec); \ - *__time = (GFC_REAL_##KIND) sec + \ - ((GFC_REAL_##KIND) usec) * 1.e-6; \ +extern void cpu_time_4 (GFC_REAL_4 *); +iexport_proto(cpu_time_4); + +void cpu_time_4 (GFC_REAL_4 *time) +{ + long sec, usec; + __cpu_time_1 (&sec, &usec); + *time = sec + usec * (GFC_REAL_4)1.e-6; } +iexport(cpu_time_4); -CPU_TIME(4) -CPU_TIME(8) +extern void cpu_time_8 (GFC_REAL_8 *); +export_proto(cpu_time_8); + +void cpu_time_8 (GFC_REAL_8 *time) +{ + long sec, usec; + __cpu_time_1 (&sec, &usec); + *time = sec + usec * (GFC_REAL_8)1.e-6; +} + +extern void second_sub (GFC_REAL_4 *); +export_proto(second_sub); void -prefix(second_sub) (GFC_REAL_4 *s) +second_sub (GFC_REAL_4 *s) { - prefix(cpu_time_4)(s); + cpu_time_4 (s); } +extern GFC_REAL_4 second (void); +export_proto(second); + GFC_REAL_4 -prefix(second) (void) +second (void) { GFC_REAL_4 s; - prefix(cpu_time_4)(&s); + cpu_time_4 (&s); return s; } diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c index 6d7a801..9fd8785 100644 --- a/libgfortran/intrinsics/cshift0.c +++ b/libgfortran/intrinsics/cshift0.c @@ -238,6 +238,10 @@ __cshift0 (gfc_array_char * ret, const gfc_array_char * array, } +extern void __cshift0_4 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_4 *, const GFC_INTEGER_4 *); +export_proto_np(__cshift0_4); + void __cshift0_4 (gfc_array_char * ret, const gfc_array_char * array, const GFC_INTEGER_4 * pshift, const GFC_INTEGER_4 * pdim) @@ -245,6 +249,9 @@ __cshift0_4 (gfc_array_char * ret, const gfc_array_char * array, __cshift0 (ret, array, *pshift, pdim ? *pdim : 1); } +extern void __cshift0_8 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_8 *, const GFC_INTEGER_8 *); +export_proto_np(__cshift0_8); void __cshift0_8 (gfc_array_char * ret, const gfc_array_char * array, diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c index e0b0123..67679f8 100644 --- a/libgfortran/intrinsics/date_and_time.c +++ b/libgfortran/intrinsics/date_and_time.c @@ -121,6 +121,10 @@ Boston, MA 02111-1307, USA. */ be to use ftime. */ +extern void date_and_time (char *, char *, char *, gfc_array_i4 *, + GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4); +export_proto(date_and_time); + void date_and_time (char *__date, char *__time, diff --git a/libgfortran/intrinsics/env.c b/libgfortran/intrinsics/env.c index ab596fc..d116f1c 100644 --- a/libgfortran/intrinsics/env.c +++ b/libgfortran/intrinsics/env.c @@ -28,13 +28,14 @@ Boston, MA 02111-1307, USA. */ /* GETENV (NAME, VALUE), g77 intrinsic for retrieving the value of - an environment variable. The name of the variable is specified in - NAME, and the result is stored into VALUE. */ + an environment variable. The name of the variable is specified in + NAME, and the result is stored into VALUE. */ + +void PREFIX(getenv) (char *, char *, gfc_charlen_type, gfc_charlen_type); +export_proto_np(PREFIX(getenv)); void -prefix(getenv) (char * name, - char * value, - gfc_charlen_type name_len, +PREFIX(getenv) (char * name, char * value, gfc_charlen_type name_len, gfc_charlen_type value_len) { char *name_nt; @@ -89,16 +90,16 @@ prefix(getenv) (char * name, /* Processor-specific failure code. */ #define GFC_FAILURE 42 +extern void get_environment_variable_i4 (char *, char *, GFC_INTEGER_4 *, + GFC_INTEGER_4 *, GFC_LOGICAL_4 *, + gfc_charlen_type, gfc_charlen_type); +iexport_proto(get_environment_variable_i4); + void -prefix(get_environment_variable_i4) - ( - char *name, - char *value, - GFC_INTEGER_4 *length, - GFC_INTEGER_4 *status, - GFC_LOGICAL_4 *trim_name, - gfc_charlen_type name_len, - gfc_charlen_type value_len) +get_environment_variable_i4 (char *name, char *value, GFC_INTEGER_4 *length, + GFC_INTEGER_4 *status, GFC_LOGICAL_4 *trim_name, + gfc_charlen_type name_len, + gfc_charlen_type value_len) { int stat = GFC_SUCCESS, res_len = 0; char *name_nt; @@ -159,20 +160,21 @@ prefix(get_environment_variable_i4) if (length != NULL) *length = res_len; } +iexport(get_environment_variable_i4); /* INTEGER*8 wrapper for get_environment_variable. */ +extern void get_environment_variable_i8 (char *, char *, GFC_INTEGER_8 *, + GFC_INTEGER_8 *, GFC_LOGICAL_8 *, + gfc_charlen_type, gfc_charlen_type); +export_proto(get_environment_variable_i8); + void -prefix(get_environment_variable_i8) - ( - char *name, - char *value, - GFC_INTEGER_8 *length, - GFC_INTEGER_8 *status, - GFC_LOGICAL_8 *trim_name, - gfc_charlen_type name_len, - gfc_charlen_type value_len) +get_environment_variable_i8 (char *name, char *value, GFC_INTEGER_8 *length, + GFC_INTEGER_8 *status, GFC_LOGICAL_8 *trim_name, + gfc_charlen_type name_len, + gfc_charlen_type value_len) { GFC_INTEGER_4 length4, status4; GFC_LOGICAL_4 trim_name4; @@ -180,8 +182,8 @@ prefix(get_environment_variable_i8) if (trim_name) trim_name4 = *trim_name; - prefix (get_environment_variable_i4) (name, value, &length4, &status4, - &trim_name4, name_len, value_len); + get_environment_variable_i4 (name, value, &length4, &status4, + &trim_name4, name_len, value_len); if (length) *length = length4; diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c index db9dd657..df749a4 100644 --- a/libgfortran/intrinsics/eoshift0.c +++ b/libgfortran/intrinsics/eoshift0.c @@ -187,6 +187,10 @@ __eoshift0 (gfc_array_char * ret, const gfc_array_char * array, } } +extern void __eoshift0_4 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_4 *, const char *, + const GFC_INTEGER_4 *); +export_proto_np(__eoshift0_4); void __eoshift0_4 (gfc_array_char * ret, const gfc_array_char * array, @@ -196,6 +200,10 @@ __eoshift0_4 (gfc_array_char * ret, const gfc_array_char * array, __eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1); } +extern void __eoshift0_8 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_8 *, const char *, + const GFC_INTEGER_8 *); +export_proto_np(__eoshift0_8); void __eoshift0_8 (gfc_array_char * ret, const gfc_array_char * array, diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c index a20da55..388486d 100644 --- a/libgfortran/intrinsics/eoshift2.c +++ b/libgfortran/intrinsics/eoshift2.c @@ -203,6 +203,10 @@ __eoshift2 (gfc_array_char * ret, const gfc_array_char * array, } } +extern void __eoshift2_4 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_4 *, const gfc_array_char *, + const GFC_INTEGER_4 *); +export_proto_np(__eoshift2_4); void __eoshift2_4 (gfc_array_char * ret, const gfc_array_char * array, @@ -212,6 +216,10 @@ __eoshift2_4 (gfc_array_char * ret, const gfc_array_char * array, __eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1); } +extern void __eoshift2_8 (gfc_array_char *, const gfc_array_char *, + const GFC_INTEGER_8 *, const gfc_array_char *, + const GFC_INTEGER_8 *); +export_proto_np(__eoshift2_8); void __eoshift2_8 (gfc_array_char * ret, const gfc_array_char * array, diff --git a/libgfortran/intrinsics/etime.c b/libgfortran/intrinsics/etime.c index d8c2f11..9a8f976 100644 --- a/libgfortran/intrinsics/etime.c +++ b/libgfortran/intrinsics/etime.c @@ -30,8 +30,11 @@ Boston, MA 02111-1307, USA. */ #include <sys/resource.h> #endif +extern void etime_sub (gfc_array_r4 *t, GFC_REAL_4 *result); +iexport_proto(etime_sub); + void -prefix(etime_sub) (gfc_array_r4 *t, GFC_REAL_4 *result) +etime_sub (gfc_array_r4 *t, GFC_REAL_4 *result) { GFC_REAL_4 tu, ts, tt, *tp; index_type dim; @@ -70,18 +73,25 @@ prefix(etime_sub) (gfc_array_r4 *t, GFC_REAL_4 *result) *tp = ts; *result = tt; } +iexport(etime_sub); + +extern GFC_REAL_4 etime (gfc_array_r4 *t); +export_proto(etime); GFC_REAL_4 -prefix(etime) (gfc_array_r4 *t) +etime (gfc_array_r4 *t) { GFC_REAL_4 val; - prefix(etime_sub) (t, &val); + etime_sub (t, &val); return val; } /* LAPACK's test programs declares ETIME external, therefore we need this. */ +extern GFC_REAL_4 etime_ (GFC_REAL_4 *t); +export_proto_np(etime_); + GFC_REAL_4 etime_ (GFC_REAL_4 *t) { @@ -94,6 +104,6 @@ etime_ (GFC_REAL_4 *t) desc.dim[0].stride = 1; desc.data = t; - prefix(etime_sub) (&desc, &val); + etime_sub (&desc, &val); return val; } diff --git a/libgfortran/intrinsics/exit.c b/libgfortran/intrinsics/exit.c index f15d567..fcb792e 100644 --- a/libgfortran/intrinsics/exit.c +++ b/libgfortran/intrinsics/exit.c @@ -30,18 +30,20 @@ Boston, MA 02111-1307, USA. */ /* SUBROUTINE EXIT(STATUS) INTEGER, INTENT(IN), OPTIONAL :: STATUS */ +extern void exit_i4 (GFC_INTEGER_4 *); +export_proto(exit_i4); + void -prefix(exit_i4) (GFC_INTEGER_4 * status) +exit_i4 (GFC_INTEGER_4 * status) { - if (status == NULL) - exit(0); - exit(*status); + exit (status ? *status : 0); } +extern void exit_i8 (GFC_INTEGER_8 *); +export_proto(exit_i8); + void -prefix(exit_i8) (GFC_INTEGER_8 * status) +exit_i8 (GFC_INTEGER_8 * status) { - if (status == NULL) - exit(0); - exit((int) *status); + exit (status ? *status : 0); } diff --git a/libgfortran/intrinsics/flush.c b/libgfortran/intrinsics/flush.c index 5f75195..3e70909 100644 --- a/libgfortran/intrinsics/flush.c +++ b/libgfortran/intrinsics/flush.c @@ -45,8 +45,11 @@ recursive_flush (gfc_unit *us) } +extern void flush_i4 (GFC_INTEGER_4 *); +export_proto(flush_i4); + void -prefix(flush_i4) (GFC_INTEGER_4 * unit) +flush_i4 (GFC_INTEGER_4 *unit) { gfc_unit *us; diff --git a/libgfortran/intrinsics/fnum.c b/libgfortran/intrinsics/fnum.c index 251cfb4..f559464 100644 --- a/libgfortran/intrinsics/fnum.c +++ b/libgfortran/intrinsics/fnum.c @@ -28,15 +28,20 @@ Boston, MA 02111-1307, USA. */ INTEGER FNUM INTEGER, INTENT(IN), :: UNIT */ +extern GFC_INTEGER_4 fnum_i4 (GFC_INTEGER_4 *); +export_proto(fnum_i4); + GFC_INTEGER_4 -prefix(fnum_i4) (GFC_INTEGER_4 * unit) +fnum_i4 (GFC_INTEGER_4 *unit) { return unit_to_fd (*unit); } +extern GFC_INTEGER_8 fnum_i8 (GFC_INTEGER_8 *); +export_proto(fnum_i8); GFC_INTEGER_8 -prefix(fnum_i8) (GFC_INTEGER_8 * unit) +fnum_i8 (GFC_INTEGER_8 * unit) { return unit_to_fd (*unit); } diff --git a/libgfortran/intrinsics/getXid.c b/libgfortran/intrinsics/getXid.c index 01aec12..4690d14 100644 --- a/libgfortran/intrinsics/getXid.c +++ b/libgfortran/intrinsics/getXid.c @@ -30,22 +30,34 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" #ifdef HAVE_GETGID -GFC_INTEGER_4 prefix(getgid) (void) +extern GFC_INTEGER_4 PREFIX(getgid) (void); +export_proto_np(PREFIX(getgid)); + +GFC_INTEGER_4 +PREFIX(getgid) (void) { - return (GFC_INTEGER_4) getgid (); + return getgid (); } #endif #ifdef HAVE_GETPID -GFC_INTEGER_4 prefix(getpid) (void) +extern GFC_INTEGER_4 PREFIX(getpid) (void); +export_proto_np(PREFIX(getpid)); + +GFC_INTEGER_4 +PREFIX(getpid) (void) { - return (GFC_INTEGER_4) getpid (); + return getpid (); } #endif #ifdef HAVE_GETUID -GFC_INTEGER_4 prefix(getuid) (void) +extern GFC_INTEGER_4 PREFIX(getuid) (void); +export_proto_np(PREFIX(getuid)); + +GFC_INTEGER_4 +PREFIX(getuid) (void) { - return (GFC_INTEGER_4) getuid (); + return getuid (); } #endif diff --git a/libgfortran/intrinsics/getcwd.c b/libgfortran/intrinsics/getcwd.c index 86afa6c..318a3a95 100644 --- a/libgfortran/intrinsics/getcwd.c +++ b/libgfortran/intrinsics/getcwd.c @@ -31,9 +31,11 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> +extern void getcwd_i4_sub (char *, GFC_INTEGER_4 *, gfc_charlen_type); +iexport_proto(getcwd_i4_sub); + void -prefix(getcwd_i4_sub) (char * cwd, GFC_INTEGER_4 * status, - gfc_charlen_type cwd_len) +getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len) { char str[cwd_len + 1], *s; GFC_INTEGER_4 stat; @@ -50,22 +52,27 @@ prefix(getcwd_i4_sub) (char * cwd, GFC_INTEGER_4 * status, if (status != NULL) *status = stat; } +iexport(getcwd_i4_sub); + +extern void getcwd_i8_sub (char *, GFC_INTEGER_8 *, gfc_charlen_type); +export_proto(getcwd_i8_sub); void -prefix(getcwd_i8_sub) (char * cwd, GFC_INTEGER_8 * status, - gfc_charlen_type cwd_len) +getcwd_i8_sub (char *cwd, GFC_INTEGER_8 *status, gfc_charlen_type cwd_len) { GFC_INTEGER_4 status4; - - prefix (getcwd_i4_sub) (cwd, &status4, cwd_len); + getcwd_i4_sub (cwd, &status4, cwd_len); if (status) *status = status4; } +extern GFC_INTEGER_4 PREFIX(getcwd) (char *, gfc_charlen_type); +export_proto_np(PREFIX(getcwd)); + GFC_INTEGER_4 -prefix(getcwd) (char * cwd, gfc_charlen_type cwd_len) +PREFIX(getcwd) (char *cwd, gfc_charlen_type cwd_len) { GFC_INTEGER_4 status; - prefix(getcwd_i4_sub) (cwd, &status, cwd_len); + getcwd_i4_sub (cwd, &status, cwd_len); return status; } diff --git a/libgfortran/intrinsics/ishftc.c b/libgfortran/intrinsics/ishftc.c index 2677c33..7d5767c 100644 --- a/libgfortran/intrinsics/ishftc.c +++ b/libgfortran/intrinsics/ishftc.c @@ -21,11 +21,8 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" -#define ishftc4 prefix(ishftc4) -GFC_INTEGER_4 ishftc4 (GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4); - -#define ishftc8 prefix(ishftc8) -GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8, GFC_INTEGER_8, GFC_INTEGER_8); +extern GFC_INTEGER_4 ishftc4 (GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4); +export_proto(ishftc4); GFC_INTEGER_4 ishftc4 (GFC_INTEGER_4 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size) @@ -44,6 +41,8 @@ ishftc4 (GFC_INTEGER_4 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size) return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask); } +extern GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8, GFC_INTEGER_8, GFC_INTEGER_8); +export_proto(ishftc8); GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_8 shift, GFC_INTEGER_8 size) diff --git a/libgfortran/intrinsics/mvbits.c b/libgfortran/intrinsics/mvbits.c index 97fdc41..140547b 100644 --- a/libgfortran/intrinsics/mvbits.c +++ b/libgfortran/intrinsics/mvbits.c @@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */ /* MVBITS copies LEN bits starting at bit position FROMPOS from FROM into TO, starting at bit position TOPOS. */ +extern void SUB_NAME (const TYPE *, const GFC_INTEGER_4 *, + const GFC_INTEGER_4 *, TYPE *, const GFC_INTEGER_4 *); +export_proto(SUB_NAME); + void SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, const GFC_INTEGER_4 *len, TYPE *to, const GFC_INTEGER_4 *topos) @@ -46,7 +50,7 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, #ifndef SUB_NAME # define TYPE GFC_INTEGER_4 # define UTYPE GFC_UINTEGER_4 -# define SUB_NAME prefix (mvbits_i4) +# define SUB_NAME mvbits_i4 # include "mvbits.c" # undef SUB_NAME # undef TYPE @@ -54,7 +58,7 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, # define TYPE GFC_INTEGER_8 # define UTYPE GFC_UINTEGER_8 -# define SUB_NAME prefix (mvbits_i8) +# define SUB_NAME mvbits_i8 # include "mvbits.c" # undef SUB_NAME # undef TYPE diff --git a/libgfortran/intrinsics/pack_generic.c b/libgfortran/intrinsics/pack_generic.c index 75a8661..0332b79 100644 --- a/libgfortran/intrinsics/pack_generic.c +++ b/libgfortran/intrinsics/pack_generic.c @@ -65,6 +65,10 @@ Boston, MA 02111-1307, USA. */ There are two variants of the PACK intrinsic: one, where MASK is array valued, and the other one where MASK is scalar. */ +extern void __pack (gfc_array_char *, const gfc_array_char *, + const gfc_array_l4 *, const gfc_array_char *); +export_proto_np(__pack); + void __pack (gfc_array_char * ret, const gfc_array_char * array, const gfc_array_l4 * mask, const gfc_array_char * vector) @@ -265,6 +269,10 @@ __pack (gfc_array_char * ret, const gfc_array_char * array, } } +extern void __pack_s (gfc_array_char *ret, const gfc_array_char *array, + const GFC_LOGICAL_4 *, const gfc_array_char *); +export_proto_np(__pack_s); + void __pack_s (gfc_array_char * ret, const gfc_array_char * array, const GFC_LOGICAL_4 * mask, const gfc_array_char * vector) diff --git a/libgfortran/intrinsics/rand.c b/libgfortran/intrinsics/rand.c index f4e78d0..7989020 100644 --- a/libgfortran/intrinsics/rand.c +++ b/libgfortran/intrinsics/rand.c @@ -38,19 +38,29 @@ static GFC_UINTEGER_8 rand_seed = 1; /* Set the seed of the irand generator. Note 0 is a bad seed. */ -void -prefix(srand) (GFC_INTEGER_4 *i) +static void +srand_internal (GFC_INTEGER_8 i) { - rand_seed = (GFC_UINTEGER_8) (*i != 0) ? *i : 123459876; + rand_seed = i ? i : 123459876; } +extern void PREFIX(srand) (GFC_INTEGER_4 *i); +export_proto_np(PREFIX(srand)); + +void +PREFIX(srand) (GFC_INTEGER_4 *i) +{ + srand_internal (*i); +} /* Return an INTEGER in the range [1,GFC_RAND_M-1]. */ +extern GFC_INTEGER_4 irand (GFC_INTEGER_4 *); +iexport_proto(irand); + GFC_INTEGER_4 -prefix(irand) (GFC_INTEGER_4 *i) +irand (GFC_INTEGER_4 *i) { - GFC_INTEGER_4 j; if (i) j = *i; @@ -66,25 +76,29 @@ prefix(irand) (GFC_INTEGER_4 *i) /* Reset the RN sequence to system-dependent sequence and return the first value. */ case 1: - j = 0; - prefix(srand) (&j); + srand_internal (0); break; /* Seed the RN sequence with j and return the first value. */ default: - prefix(srand) (&j); + srand_internal (j); + break; } rand_seed = GFC_RAND_A * rand_seed % GFC_RAND_M; return (GFC_INTEGER_4) rand_seed; } +iexport(irand); /* Return a random REAL in the range [0,1). */ +extern GFC_REAL_4 PREFIX(rand) (GFC_INTEGER_4 *i); +export_proto_np(PREFIX(rand)); + GFC_REAL_4 -prefix(rand) (GFC_INTEGER_4 *i) +PREFIX(rand) (GFC_INTEGER_4 *i) { - return normalize_r4_i4 (prefix(irand) (i) - 1, GFC_RAND_M1 - 1); + return normalize_r4_i4 (irand (i) - 1, GFC_RAND_M1 - 1); } diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index 2cc5d20..0ea60ecc 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -20,6 +20,20 @@ License along with libgfor; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "libgfortran.h" + +extern void random_r4 (GFC_REAL_4 *); +iexport_proto(random_r4); + +extern void random_r8 (GFC_REAL_8 *); +iexport_proto(random_r8); + +extern void arandom_r4 (gfc_array_r4 *); +export_proto(arandom_r4); + +extern void arandom_r8 (gfc_array_r8 *); +export_proto(arandom_r8); + #if 0 /* The Mersenne Twister code is currently commented out due to @@ -45,7 +59,6 @@ Boston, MA 02111-1307, USA. */ Generation. ( Early in 1998 ). */ -#include "config.h" #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -56,8 +69,6 @@ Boston, MA 02111-1307, USA. */ #include <unistd.h> #endif -#include "libgfortran.h" - /*Use the 'big' generator by default ( period -> 2**19937 ). */ #define MT19937 @@ -89,8 +100,7 @@ static unsigned int seed[N]; and also reading and writing of the seed. */ void -random_seed (GFC_INTEGER_4 * size, const gfc_array_i4 * put, - const gfc_array_i4 * get) +random_seed (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get) { /* Initialize the seed in system dependent manner. */ if (get == NULL && put == NULL && size == NULL) @@ -167,6 +177,7 @@ random_seed (GFC_INTEGER_4 * size, const gfc_array_i4 * put, get->data[i * get->dim[0].stride] = seed[i]; } } +iexport(random_seed); /* Here is the internal routine which generates the random numbers in 'batches' based upon the need for a new batch. @@ -197,7 +208,6 @@ random_generate (void) /* A routine to return a REAL(KIND=4). */ -#define random_r4 prefix(random_r4) void random_r4 (GFC_REAL_4 * harv) { @@ -209,10 +219,10 @@ random_r4 (GFC_REAL_4 * harv) *harv = (GFC_REAL_4) ((GFC_REAL_4) (GFC_UINTEGER_4) seed[i++] / (GFC_REAL_4) (~(GFC_UINTEGER_4) 0)); } +iexport(random_r4); /* A routine to return a REAL(KIND=8). */ -#define random_r8 prefix(random_r8) void random_r8 (GFC_REAL_8 * harv) { @@ -225,12 +235,12 @@ random_r8 (GFC_REAL_8 * harv) (GFC_REAL_8) (~(GFC_UINTEGER_8) 0); i += 2; } +iexport(random_r8); /* Code to handle arrays will follow here. */ /* REAL(KIND=4) REAL array. */ -#define arandom_r4 prefix(arandom_r4) void arandom_r4 (gfc_array_r4 * harv) { @@ -304,7 +314,6 @@ arandom_r4 (gfc_array_r4 * harv) /* REAL(KIND=8) array. */ -#define arandom_r8 prefix(arandom_r8) void arandom_r8 (gfc_array_r8 * harv) { @@ -376,8 +385,8 @@ arandom_r8 (gfc_array_r8 * harv) } } } -#endif /* Mersenne Twister code */ +#else /* George Marsaglia's KISS (Keep It Simple Stupid) random number generator. @@ -418,9 +427,6 @@ arandom_r8 (gfc_array_r8 * harv) "There is no copyright on the code below." included the original KISS algorithm. */ -#include "config.h" -#include "libgfortran.h" - #define GFC_SL(k, n) ((k)^((k)<<(n))) #define GFC_SR(k, n) ((k)^((k)>>(n))) @@ -436,7 +442,6 @@ static GFC_UINTEGER_4 kiss_seed[4] = KISS_DEFAULT_SEED; static GFC_UINTEGER_4 kiss_random_kernel(void) { - GFC_UINTEGER_4 kiss; kiss_seed[0] = 69069 * kiss_seed[0] + 1327217885; @@ -446,16 +451,14 @@ kiss_random_kernel(void) kiss = kiss_seed[0] + kiss_seed[1] + (kiss_seed[2] << 16) + kiss_seed[3]; return kiss; - } /* This function produces a REAL(4) value from the uniform distribution with range [0,1). */ void -prefix(random_r4) (GFC_REAL_4 *x) +random_r4 (GFC_REAL_4 *x) { - GFC_UINTEGER_4 kiss; kiss = kiss_random_kernel (); @@ -464,26 +467,27 @@ prefix(random_r4) (GFC_REAL_4 *x) kiss_random_kernel (); *x = normalize_r4_i4 (kiss, ~(GFC_UINTEGER_4) 0); } +iexport(random_r4); /* This function produces a REAL(8) value from the uniform distribution with range [0,1). */ void -prefix(random_r8) (GFC_REAL_8 *x) +random_r8 (GFC_REAL_8 *x) { - GFC_UINTEGER_8 kiss; kiss = ((GFC_UINTEGER_8)kiss_random_kernel ()) << 32; kiss += kiss_random_kernel (); *x = normalize_r8_i8 (kiss, ~(GFC_UINTEGER_8) 0); } +iexport(random_r8); /* This function fills a REAL(4) array with values from the uniform distribution with range [0,1). */ void -prefix(arandom_r4) (gfc_array_r4 *x) +arandom_r4 (gfc_array_r4 *x) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -513,7 +517,7 @@ prefix(arandom_r4) (gfc_array_r4 *x) while (dest) { - prefix(random_r4) (dest); + random_r4 (dest); /* Advance to the next element. */ dest += stride0; @@ -547,7 +551,7 @@ prefix(arandom_r4) (gfc_array_r4 *x) distribution with range [0,1). */ void -prefix(arandom_r8) (gfc_array_r8 *x) +arandom_r8 (gfc_array_r8 *x) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -577,7 +581,7 @@ prefix(arandom_r8) (gfc_array_r8 *x) while (dest) { - prefix(random_r8) (dest); + random_r8 (dest); /* Advance to the next element. */ dest += stride0; @@ -607,8 +611,8 @@ prefix(arandom_r8) (gfc_array_r8 *x) } } -/* prefix(random_seed) is used to seed the PRNG with either a default - set of seeds or user specified set of seeds. prefix(random_seed) +/* random_seed is used to seed the PRNG with either a default + set of seeds or user specified set of seeds. random_seed must be called with no argument or exactly one argument. */ void @@ -666,3 +670,6 @@ random_seed (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get) get->data[i * get->dim[0].stride] = (GFC_INTEGER_4) kiss_seed[i]; } } +iexport(random_seed); + +#endif /* mersenne twister */ diff --git a/libgfortran/intrinsics/reshape_generic.c b/libgfortran/intrinsics/reshape_generic.c index 5314456..aecc6b6 100644 --- a/libgfortran/intrinsics/reshape_generic.c +++ b/libgfortran/intrinsics/reshape_generic.c @@ -28,6 +28,9 @@ Boston, MA 02111-1307, USA. */ typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type; typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) parray; +extern void __reshape (parray *, parray *, shape_type *, + parray *, shape_type *); +export_proto_np(__reshape); /* The shape parameter is ignored. We can currently deduce the shape from the return array. */ diff --git a/libgfortran/intrinsics/size.c b/libgfortran/intrinsics/size.c index f83f6c0..b001f34 100644 --- a/libgfortran/intrinsics/size.c +++ b/libgfortran/intrinsics/size.c @@ -21,7 +21,8 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" -index_type size0 (const array_t * array) +index_type +size0 (const array_t * array) { int n; index_type size; @@ -37,9 +38,13 @@ index_type size0 (const array_t * array) } return size; } +iexport(size0); -#define size1 prefix(size1) -index_type size1 (const array_t * array, index_type dim) +extern index_type size1 (const array_t * array, index_type dim); +export_proto(size1); + +index_type +size1 (const array_t * array, index_type dim) { index_type size; diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c index f65f869..0cada54 100644 --- a/libgfortran/intrinsics/spread_generic.c +++ b/libgfortran/intrinsics/spread_generic.c @@ -25,6 +25,10 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +extern void __spread (const gfc_array_char *, const gfc_array_char *, + const index_type *, const index_type *); +export_proto_np(__spread); + void __spread (const gfc_array_char * ret, const gfc_array_char * source, const index_type * along, const index_type * pncopies) diff --git a/libgfortran/intrinsics/stat.c b/libgfortran/intrinsics/stat.c index 8f250d4..de4a147 100644 --- a/libgfortran/intrinsics/stat.c +++ b/libgfortran/intrinsics/stat.c @@ -52,9 +52,13 @@ Boston, MA 02111-1307, USA. */ CHARACTER(len=*), INTENT(IN) :: FILE INTEGER, INTENT(OUT), :: SARRAY(13) */ +extern void stat_i4_sub (char *, gfc_array_i4 *, GFC_INTEGER_4 *, + gfc_charlen_type); +iexport_proto(stat_i4_sub); + void -prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray, - GFC_INTEGER_4 * status, gfc_charlen_type name_len) +stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status, + gfc_charlen_type name_len) { int val; char *str; @@ -68,10 +72,10 @@ prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray, /* If the array is too small, abort. */ if (sarray->dim[0].ubound + 1 - sarray->dim[0].lbound < 13) - runtime_error ("Array size of SARRAY is too small."); + runtime_error ("Array size of SARRAY is too small."); if (sarray->dim[0].stride == 0) - sarray->dim[0].stride = 1; + sarray->dim[0].stride = 1; /* Trim trailing spaces from name. */ while (name_len > 0 && name[name_len - 1] == ' ') @@ -141,10 +145,15 @@ prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray, if (status != NULL) *status = (val == 0) ? 0 : errno; } +iexport(stat_i4_sub); + +extern void stat_i8_sub (char *, gfc_array_i8 *, GFC_INTEGER_8 *, + gfc_charlen_type); +iexport_proto(stat_i8_sub); void -prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray, - GFC_INTEGER_8 * status, gfc_charlen_type name_len) +stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status, + gfc_charlen_type name_len) { int val; char *str; @@ -158,10 +167,10 @@ prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray, /* If the array is too small, abort. */ if (sarray->dim[0].ubound + 1 - sarray->dim[0].lbound < 13) - runtime_error ("Array size of SARRAY is too small."); + runtime_error ("Array size of SARRAY is too small."); if (sarray->dim[0].stride == 0) - sarray->dim[0].stride = 1; + sarray->dim[0].stride = 1; /* Trim trailing spaces from name. */ while (name_len > 0 && name[name_len - 1] == ' ') @@ -231,25 +240,27 @@ prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray, if (status != NULL) *status = (val == 0) ? 0 : errno; } +iexport(stat_i8_sub); +extern GFC_INTEGER_4 stat_i4 (char *, gfc_array_i4 *, gfc_charlen_type); +export_proto(stat_i4); GFC_INTEGER_4 -prefix(stat_i4) (char * name, gfc_array_i4 * sarray, - gfc_charlen_type name_len) +stat_i4 (char *name, gfc_array_i4 *sarray, gfc_charlen_type name_len) { - GFC_INTEGER_4 val; - prefix(stat_i4_sub) (name, sarray, &val, name_len); + stat_i4_sub (name, sarray, &val, name_len); return val; } +extern GFC_INTEGER_8 stat_i8 (char *, gfc_array_i8 *, gfc_charlen_type); +export_proto(stat_i8); GFC_INTEGER_8 -prefix(stat_i8) (char * name, gfc_array_i8 * sarray, - gfc_charlen_type name_len) +stat_i8 (char *name, gfc_array_i8 *sarray, gfc_charlen_type name_len) { GFC_INTEGER_8 val; - prefix(stat_i8_sub) (name, sarray, &val, name_len); + stat_i8_sub (name, sarray, &val, name_len); return val; } @@ -264,9 +275,11 @@ prefix(stat_i8) (char * name, gfc_array_i8 * sarray, INTEGER, INTENT(IN) :: UNIT INTEGER, INTENT(OUT) :: SARRAY(13) */ +extern void fstat_i4_sub (GFC_INTEGER_4 *, gfc_array_i4 *, GFC_INTEGER_4 *); +iexport_proto(fstat_i4_sub); + void -prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray, - GFC_INTEGER_4 * status) +fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status) { int val; struct stat sb; @@ -279,10 +292,10 @@ prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray, /* If the array is too small, abort. */ if (sarray->dim[0].ubound + 1 - sarray->dim[0].lbound < 13) - runtime_error ("Array size of SARRAY is too small."); + runtime_error ("Array size of SARRAY is too small."); if (sarray->dim[0].stride == 0) - sarray->dim[0].stride = 1; + sarray->dim[0].stride = 1; /* Convert Fortran unit number to C file descriptor. */ val = unit_to_fd (*unit); @@ -346,10 +359,13 @@ prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray, if (status != NULL) *status = (val == 0) ? 0 : errno; } +iexport(fstat_i4_sub); + +extern void fstat_i8_sub (GFC_INTEGER_8 *, gfc_array_i8 *, GFC_INTEGER_8 *); +iexport_proto(fstat_i8_sub); void -prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, - GFC_INTEGER_8 * status) +fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status) { int val; struct stat sb; @@ -362,10 +378,10 @@ prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, /* If the array is too small, abort. */ if (sarray->dim[0].ubound + 1 - sarray->dim[0].lbound < 13) - runtime_error ("Array size of SARRAY is too small."); + runtime_error ("Array size of SARRAY is too small."); if (sarray->dim[0].stride == 0) - sarray->dim[0].stride = 1; + sarray->dim[0].stride = 1; /* Convert Fortran unit number to C file descriptor. */ val = unit_to_fd ((int) *unit); @@ -429,21 +445,26 @@ prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, if (status != NULL) *status = (val == 0) ? 0 : errno; } +iexport(fstat_i8_sub); +extern GFC_INTEGER_4 fstat_i4 (GFC_INTEGER_4 *, gfc_array_i4 *); +export_proto(fstat_i4); GFC_INTEGER_4 -prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray) +fstat_i4 (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray) { GFC_INTEGER_4 val; - prefix(fstat_i4_sub) (unit, sarray, &val); + fstat_i4_sub (unit, sarray, &val); return val; } +extern GFC_INTEGER_8 fstat_i8 (GFC_INTEGER_8 *, gfc_array_i8 *); +export_proto(fstat_i8); GFC_INTEGER_8 -prefix(fstat_i8) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray) +fstat_i8 (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray) { GFC_INTEGER_8 val; - prefix(fstat_i8_sub) (unit, sarray, &val); + fstat_i8_sub (unit, sarray, &val); return val; } diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index faacaab..f5b5bc1 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -35,40 +35,40 @@ Boston, MA 02111-1307, USA. */ /* String functions. */ -#define copy_string prefix(copy_string) -void copy_string (GFC_INTEGER_4, char *, GFC_INTEGER_4, const char *); +extern void copy_string (GFC_INTEGER_4, char *, GFC_INTEGER_4, const char *); +export_proto(copy_string); -#define concat_string prefix(concat_string) -void concat_string (GFC_INTEGER_4, char *, - GFC_INTEGER_4, const char *, - GFC_INTEGER_4, const char *); +extern void concat_string (GFC_INTEGER_4, char *, + GFC_INTEGER_4, const char *, + GFC_INTEGER_4, const char *); +export_proto(concat_string); -#define string_len_trim prefix(string_len_trim) -GFC_INTEGER_4 string_len_trim (GFC_INTEGER_4, const char *); +extern GFC_INTEGER_4 string_len_trim (GFC_INTEGER_4, const char *); +export_proto(string_len_trim); -#define adjustl prefix(adjustl) -void adjustl (char *, GFC_INTEGER_4, const char *); +extern void adjustl (char *, GFC_INTEGER_4, const char *); +export_proto(adjustl); -#define adjustr prefix(adjustr) -void adjustr (char *, GFC_INTEGER_4, const char *); +extern void adjustr (char *, GFC_INTEGER_4, const char *); +export_proto(adjustr); -#define string_index prefix(string_index) -GFC_INTEGER_4 string_index (GFC_INTEGER_4, const char *, GFC_INTEGER_4, - const char *, GFC_LOGICAL_4); +extern GFC_INTEGER_4 string_index (GFC_INTEGER_4, const char *, GFC_INTEGER_4, + const char *, GFC_LOGICAL_4); +export_proto(string_index); -#define string_scan prefix(string_scan) -GFC_INTEGER_4 string_scan (GFC_INTEGER_4, const char *, GFC_INTEGER_4, - const char *, GFC_LOGICAL_4); +extern GFC_INTEGER_4 string_scan (GFC_INTEGER_4, const char *, GFC_INTEGER_4, + const char *, GFC_LOGICAL_4); +export_proto(string_scan); -#define string_verify prefix(string_verify) -GFC_INTEGER_4 string_verify (GFC_INTEGER_4, const char *, GFC_INTEGER_4, - const char *, GFC_LOGICAL_4); +extern GFC_INTEGER_4 string_verify (GFC_INTEGER_4, const char *, GFC_INTEGER_4, + const char *, GFC_LOGICAL_4); +export_proto(string_verify); -#define string_trim prefix(string_trim) -void string_trim (GFC_INTEGER_4 *, void **, GFC_INTEGER_4, const char *); +extern void string_trim (GFC_INTEGER_4 *, void **, GFC_INTEGER_4, const char *); +export_proto(string_trim); -#define string_repeat prefix(string_repeat) -void string_repeat (char *, GFC_INTEGER_4, const char *, GFC_INTEGER_4); +extern void string_repeat (char *, GFC_INTEGER_4, const char *, GFC_INTEGER_4); +export_proto(string_repeat); /* The two areas may overlap so we use memmove. */ @@ -136,6 +136,7 @@ compare_string (GFC_INTEGER_4 len1, const char * s1, return 0; } +iexport(compare_string); /* The destination and source should not overlap. */ diff --git a/libgfortran/intrinsics/system.c b/libgfortran/intrinsics/system.c index d962601..308717e 100644 --- a/libgfortran/intrinsics/system.c +++ b/libgfortran/intrinsics/system.c @@ -39,9 +39,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "libgfortran.h" +extern void system_sub (const char *fcmd, GFC_INTEGER_4 * status, + gfc_charlen_type cmd_len); +iexport_proto(system_sub); + void -prefix(system_sub) (const char * fcmd, GFC_INTEGER_4 * status, - gfc_charlen_type cmd_len) +system_sub (const char *fcmd, GFC_INTEGER_4 *status, gfc_charlen_type cmd_len) { char cmd[cmd_len + 1]; int stat; @@ -53,12 +56,15 @@ prefix(system_sub) (const char * fcmd, GFC_INTEGER_4 * status, if (status) *status = stat; } +iexport(system_sub); + +extern GFC_INTEGER_4 PREFIX(system) (const char *, gfc_charlen_type); +export_proto_np(PREFIX(system)); GFC_INTEGER_4 -prefix(system) (char * fcmd, gfc_charlen_type cmd_len) +PREFIX(system) (const char *fcmd, gfc_charlen_type cmd_len) { GFC_INTEGER_4 stat; - - prefix(system_sub) (fcmd, &stat, cmd_len); + system_sub (fcmd, &stat, cmd_len); return stat; } diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index d11d1a9..b778b03 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -41,14 +41,22 @@ static struct timeval tp0 = {-1, 0}; static time_t t0 = (time_t) -2; #endif + +extern void system_clock_4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *); +export_proto(system_clock_4); + +extern void system_clock_8 (GFC_INTEGER_8 *, GFC_INTEGER_8 *, GFC_INTEGER_8 *); +export_proto(system_clock_8); + + /* prefix(system_clock_4) is the INTEGER(4) version of the SYSTEM_CLOCK intrinsic subroutine. It returns the number of clock ticks for the current system time, the number of ticks per second, and the maximum possible value for COUNT. On the first call to SYSTEM_CLOCK, COUNT is set to zero. */ void -prefix(system_clock_4)(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate, - GFC_INTEGER_4 *count_max) +system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate, + GFC_INTEGER_4 *count_max) { GFC_INTEGER_4 cnt; GFC_INTEGER_4 rate; @@ -123,8 +131,8 @@ prefix(system_clock_4)(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate, /* INTEGER(8) version of the above routine. */ void -prefix(system_clock_8)(GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate, - GFC_INTEGER_8 *count_max) +system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate, + GFC_INTEGER_8 *count_max) { GFC_INTEGER_8 cnt; GFC_INTEGER_8 rate; diff --git a/libgfortran/intrinsics/transpose_generic.c b/libgfortran/intrinsics/transpose_generic.c index 55d2729..ba3014f 100644 --- a/libgfortran/intrinsics/transpose_generic.c +++ b/libgfortran/intrinsics/transpose_generic.c @@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ #include <assert.h> #include "libgfortran.h" +extern void __transpose (gfc_array_char *, gfc_array_char *); +export_proto_np(__transpose); + void __transpose (gfc_array_char * ret, gfc_array_char * source) { diff --git a/libgfortran/intrinsics/umask.c b/libgfortran/intrinsics/umask.c index cf41451..2e8e165 100644 --- a/libgfortran/intrinsics/umask.c +++ b/libgfortran/intrinsics/umask.c @@ -35,41 +35,51 @@ Boston, MA 02111-1307, USA. */ INTEGER, INTENT(IN) :: MASK INTEGER, INTENT(OUT), OPTIONAL :: OLD */ +extern void umask_i4_sub (GFC_INTEGER_4 *, GFC_INTEGER_4 *); +iexport_proto(umask_i4_sub); + void -prefix(umask_i4_sub) (GFC_INTEGER_4 * mask, GFC_INTEGER_4 * old) +umask_i4_sub (GFC_INTEGER_4 *mask, GFC_INTEGER_4 *old) { - mode_t val; - - val = umask((mode_t) *mask); + mode_t val = umask((mode_t) *mask); if (old != NULL) *old = (GFC_INTEGER_4) val; } +iexport(umask_i4_sub); + +extern void umask_i8_sub (GFC_INTEGER_8 *, GFC_INTEGER_8 *); +iexport_proto(umask_i8_sub); void -prefix(umask_i8_sub) (GFC_INTEGER_8 * mask, GFC_INTEGER_8 * old) +umask_i8_sub (GFC_INTEGER_8 *mask, GFC_INTEGER_8 *old) { - mode_t val; - - val = umask((mode_t) *mask); + mode_t val = umask((mode_t) *mask); if (old != NULL) *old = (GFC_INTEGER_8) val; } +iexport(umask_i8_sub); /* INTEGER FUNCTION UMASK(MASK) INTEGER, INTENT(IN) :: MASK */ +extern GFC_INTEGER_4 umask_i4 (GFC_INTEGER_4 *); +export_proto(umask_i4); + GFC_INTEGER_4 -prefix(umask) (GFC_INTEGER_4 * mask) +umask_i4 (GFC_INTEGER_4 *mask) { GFC_INTEGER_4 old; - prefix(umask_i4_sub) (mask, &old); + umask_i4_sub (mask, &old); return old; } +extern GFC_INTEGER_8 umask_i8 (GFC_INTEGER_8 *); +export_proto(umask_i8); + GFC_INTEGER_8 -prefix(umask_i8) (GFC_INTEGER_8 * mask) +umask_i8 (GFC_INTEGER_8 *mask) { GFC_INTEGER_8 old; - prefix(umask_i8_sub) (mask, &old); + umask_i8_sub (mask, &old); return old; } diff --git a/libgfortran/intrinsics/unlink.c b/libgfortran/intrinsics/unlink.c index 7ea2a10..b918706 100644 --- a/libgfortran/intrinsics/unlink.c +++ b/libgfortran/intrinsics/unlink.c @@ -35,11 +35,13 @@ Boston, MA 02111-1307, USA. */ CHARACTER(LEN= ), INTENT(IN) :: NAME INTEGER, INTENT(OUT), OPTIONAL :: STATUS) */ +extern void unlink_i4_sub (char *name, GFC_INTEGER_4 *status, + gfc_charlen_type name_len); +iexport_proto(unlink_i4_sub); + void -prefix(unlink_i4_sub) (char * name, GFC_INTEGER_4 * status, - gfc_charlen_type name_len) +unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len) { - char *str, *s; GFC_INTEGER_4 stat; @@ -57,14 +59,17 @@ prefix(unlink_i4_sub) (char * name, GFC_INTEGER_4 * status, if (status != NULL) *status = (stat == 0) ? stat : errno; } +iexport(unlink_i4_sub); +extern void unlink_i8_sub (char *name, GFC_INTEGER_8 *status, + gfc_charlen_type name_len); +export_proto(unlink_i8_sub); void -prefix(unlink_i8_sub) (char * name, GFC_INTEGER_8 * status, - gfc_charlen_type name_len) +unlink_i8_sub (char *name, GFC_INTEGER_8 *status, gfc_charlen_type name_len) { GFC_INTEGER_4 status4; - prefix (unlink_i4_sub) (name, &status4, name_len); + unlink_i4_sub (name, &status4, name_len); if (status) *status = status4; } @@ -73,10 +78,13 @@ prefix(unlink_i8_sub) (char * name, GFC_INTEGER_8 * status, /* INTEGER FUNCTION UNLINK(NAME) CHARACTER(LEN= ), INTENT(IN) :: NAME */ +extern GFC_INTEGER_4 PREFIX(unlink) (char *, gfc_charlen_type); +export_proto_np(PREFIX(unlink)); + GFC_INTEGER_4 -prefix(unlink) (char * name, gfc_charlen_type name_len) +PREFIX(unlink) (char *name, gfc_charlen_type name_len) { GFC_INTEGER_4 status; - prefix(unlink_i4_sub) (name, &status, name_len); + unlink_i4_sub (name, &status, name_len); return status; } diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c index a301b58..16deea4 100644 --- a/libgfortran/intrinsics/unpack_generic.c +++ b/libgfortran/intrinsics/unpack_generic.c @@ -25,6 +25,10 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +extern void __unpack1 (const gfc_array_char *, const gfc_array_char *, + const gfc_array_l4 *, const gfc_array_char *); +export_proto_np(__unpack1); + void __unpack1 (const gfc_array_char * ret, const gfc_array_char * vector, const gfc_array_l4 * mask, const gfc_array_char * field) @@ -140,6 +144,10 @@ __unpack1 (const gfc_array_char * ret, const gfc_array_char * vector, } } +extern void __unpack0 (const gfc_array_char *, const gfc_array_char *, + const gfc_array_l4 *, char *); +export_proto_np(__unpack0); + void __unpack0 (const gfc_array_char * ret, const gfc_array_char * vector, const gfc_array_l4 * mask, char * field) diff --git a/libgfortran/io/backspace.c b/libgfortran/io/backspace.c index eb25b10..9cdddb6 100644 --- a/libgfortran/io/backspace.c +++ b/libgfortran/io/backspace.c @@ -114,6 +114,9 @@ unformatted_backspace (void) } +extern void st_backspace (void); +export_proto(st_backspace); + void st_backspace (void) { diff --git a/libgfortran/io/close.c b/libgfortran/io/close.c index 48d669b..827eea8 100644 --- a/libgfortran/io/close.c +++ b/libgfortran/io/close.c @@ -33,6 +33,9 @@ static st_option status_opt[] = { }; +extern void st_close (void); +export_proto(st_close); + void st_close (void) { diff --git a/libgfortran/io/endfile.c b/libgfortran/io/endfile.c index d8462a3..76a1c34 100644 --- a/libgfortran/io/endfile.c +++ b/libgfortran/io/endfile.c @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ /* endfile.c-- Implement the ENDFILE statement */ +extern void st_endfile (void); +export_proto(st_endfile); + void st_endfile (void) { diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index a93f99d..290f31c 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -356,6 +356,9 @@ inquire_via_filename (void) /* Library entry point for the INQUIRE statement (non-IOLENGTH form). */ +extern void st_inquire (void); +export_proto(st_inquire); + void st_inquire (void) { diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index e309448..e4f8f889 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */ #include <setjmp.h> #include "libgfortran.h" + #define DEFAULT_TEMPDIR "/var/tmp" /* Basic types used in data transfers. */ @@ -44,10 +45,10 @@ typedef struct stream { char *(*alloc_w_at) (struct stream *, int *, gfc_offset); char *(*alloc_r_at) (struct stream *, int *, gfc_offset); - try (*sfree) (struct stream *); - try (*close) (struct stream *); - try (*seek) (struct stream *, gfc_offset); - try (*truncate) (struct stream *); + try (*sfree) (struct stream *); + try (*close) (struct stream *); + try (*seek) (struct stream *, gfc_offset); + try (*truncate) (struct stream *); } stream; @@ -230,13 +231,11 @@ typedef struct } st_parameter; - - -#define ioparm prefix(ioparm) extern st_parameter ioparm; +iexport_data_proto(ioparm); -#define ionml prefix(ionml) extern namelist_info * ionml; +internal_proto(ionml); typedef struct { @@ -311,13 +310,11 @@ typedef struct } global_t; - -#define g prefix(g) extern global_t g; +internal_proto(g); - -#define current_unit prefix(current_unit) extern gfc_unit *current_unit; +internal_proto(current_unit); /* Format tokens. Only about half of these can be stored in the format nodes. */ @@ -384,283 +381,230 @@ fnode; /* unix.c */ -#define sys_exit prefix(sys_exit) -void sys_exit (int) __attribute__ ((noreturn)); - -#define move_pos_offset prefix(move_pos_offset) -int move_pos_offset (stream *, int); +extern int move_pos_offset (stream *, int); +internal_proto(move_pos_offset); -#define get_oserror prefix(get_oserror) -const char *get_oserror (void); +extern int compare_files (stream *, stream *); +internal_proto(compare_files); -#define compare_files prefix(compare_files) -int compare_files (stream *, stream *); +extern stream *init_error_stream (void); +internal_proto(init_error_stream); -#define init_error_stream prefix(init_error_stream) -stream *init_error_stream (void); +extern stream *open_external (unit_flags *); +internal_proto(open_external); -#define open_external prefix(open_external) -stream *open_external (unit_flags *); +extern stream *open_internal (char *, int); +internal_proto(open_internal); -#define open_internal prefix(open_internal) -stream *open_internal (char *, int); +extern stream *input_stream (void); +internal_proto(input_stream); -#define input_stream prefix(input_stream) -stream *input_stream (void); +extern stream *output_stream (void); +internal_proto(output_stream); -#define output_stream prefix(output_stream) -stream *output_stream (void); +extern int compare_file_filename (stream *, const char *, int); +internal_proto(compare_file_filename); -#define compare_file_filename prefix(compare_file_filename) -int compare_file_filename (stream *, const char *, int); +extern gfc_unit *find_file (void); +internal_proto(find_file); -#define find_file prefix(find_file) -gfc_unit *find_file (void); +extern int stream_at_bof (stream *); +internal_proto(stream_at_bof); -#define stream_at_bof prefix(stream_at_bof) -int stream_at_bof (stream *); +extern int stream_at_eof (stream *); +internal_proto(stream_at_eof); -#define stream_at_eof prefix(stream_at_eof) -int stream_at_eof (stream *); +extern int delete_file (gfc_unit *); +internal_proto(delete_file); -#define delete_file prefix(delete_file) -int delete_file (gfc_unit *); +extern int file_exists (void); +internal_proto(file_exists); -#define file_exists prefix(file_exists) -int file_exists (void); +extern const char *inquire_sequential (const char *, int); +internal_proto(inquire_sequential); -#define inquire_sequential prefix(inquire_sequential) -const char *inquire_sequential (const char *, int); +extern const char *inquire_direct (const char *, int); +internal_proto(inquire_direct); -#define inquire_direct prefix(inquire_direct) -const char *inquire_direct (const char *, int); +extern const char *inquire_formatted (const char *, int); +internal_proto(inquire_formatted); -#define inquire_formatted prefix(inquire_formatted) -const char *inquire_formatted (const char *, int); +extern const char *inquire_unformatted (const char *, int); +internal_proto(inquire_unformatted); -#define inquire_unformatted prefix(inquire_unformatted) -const char *inquire_unformatted (const char *, int); +extern const char *inquire_read (const char *, int); +internal_proto(inquire_read); -#define inquire_read prefix(inquire_read) -const char *inquire_read (const char *, int); +extern const char *inquire_write (const char *, int); +internal_proto(inquire_write); -#define inquire_write prefix(inquire_write) -const char *inquire_write (const char *, int); +extern const char *inquire_readwrite (const char *, int); +internal_proto(inquire_readwrite); -#define inquire_readwrite prefix(inquire_readwrite) -const char *inquire_readwrite (const char *, int); +extern gfc_offset file_length (stream *); +internal_proto(file_length); -#define file_length prefix(file_length) -gfc_offset file_length (stream *); +extern gfc_offset file_position (stream *); +internal_proto(file_position); -#define file_position prefix(file_position) -gfc_offset file_position (stream *); +extern int is_seekable (stream *); +internal_proto(is_seekable); -#define is_seekable prefix(is_seekable) -int is_seekable (stream *); +extern void empty_internal_buffer(stream *); +internal_proto(empty_internal_buffer); -#define empty_internal_buffer prefix(empty_internal_buffer) -void empty_internal_buffer(stream *); +extern try flush (stream *); +internal_proto(flush); -#define flush prefix(flush) -try flush (stream *); - -#define unit_to_fd prefix(unit_to_fd) -int unit_to_fd (int); +extern int unit_to_fd (int); +internal_proto(unit_to_fd); /* unit.c */ -#define insert_unit prefix(insert_unix) -void insert_unit (gfc_unit *); +extern void insert_unit (gfc_unit *); +internal_proto(insert_unit); -#define close_unit prefix(close_unit) -int close_unit (gfc_unit *); +extern int close_unit (gfc_unit *); +internal_proto(close_unit); -#define is_internal_unit prefix(is_internal_unit) -int is_internal_unit (void); +extern int is_internal_unit (void); +internal_proto(is_internal_unit); -#define find_unit prefix(find_unit) -gfc_unit *find_unit (int); +extern gfc_unit *find_unit (int); +internal_proto(find_unit); -#define get_unit prefix(get_unit) -gfc_unit *get_unit (int); +extern gfc_unit *get_unit (int); +internal_proto(get_unit); /* open.c */ -#define test_endfile prefix(test_endfile) -void test_endfile (gfc_unit *); +extern void test_endfile (gfc_unit *); +internal_proto(test_endfile); -#define new_unit prefix(new_unit) -void new_unit (unit_flags *); +extern void new_unit (unit_flags *); +internal_proto(new_unit); /* format.c */ -#define parse_format prefix(parse_format) -void parse_format (void); +extern void parse_format (void); +internal_proto(parse_format); -#define next_format prefix(next_format) -fnode *next_format (void); +extern fnode *next_format (void); +internal_proto(next_format); -#define unget_format prefix(unget_format) -void unget_format (fnode *); +extern void unget_format (fnode *); +internal_proto(unget_format); -#define format_error prefix(format_error) -void format_error (fnode *, const char *); +extern void format_error (fnode *, const char *); +internal_proto(format_error); -#define free_fnodes prefix(free_fnodes) -void free_fnodes (void); +extern void free_fnodes (void); +internal_proto(free_fnodes); /* transfer.c */ #define SCRATCH_SIZE 300 -#define scratch prefix(scratch) extern char scratch[]; +internal_proto(scratch); -#define type_name prefix(type_name) -const char *type_name (bt); - -#define read_block prefix(read_block) -void *read_block (int *); - -#define write_block prefix(write_block) -void *write_block (int); - -#define transfer_integer prefix(transfer_integer) -void transfer_integer (void *, int); - -#define transfer_real prefix(transfer_real) -void transfer_real (void *, int); +extern const char *type_name (bt); +internal_proto(type_name); -#define transfer_logical prefix(transfer_logical) -void transfer_logical (void *, int); +extern void *read_block (int *); +internal_proto(read_block); -#define transfer_character prefix(transfer_character) -void transfer_character (void *, int); +extern void *write_block (int); +internal_proto(write_block); -#define transfer_complex prefix(transfer_complex) -void transfer_complex (void *, int); - -#define next_record prefix(next_record) -void next_record (int); - -#define st_set_nml_var_int prefix(st_set_nml_var_int) -void st_set_nml_var_int (void * , char * , int , int ); - -#define st_set_nml_var_float prefix(st_set_nml_var_float) -void st_set_nml_var_float (void * , char * , int , int ); - -#define st_set_nml_var_char prefix(st_set_nml_var_char) -void st_set_nml_var_char (void * , char * , int , int, gfc_charlen_type); - -#define st_set_nml_var_complex prefix(st_set_nml_var_complex) -void st_set_nml_var_complex (void * , char * , int , int ); - -#define st_set_nml_var_log prefix(st_set_nml_var_log) -void st_set_nml_var_log (void * , char * , int , int ); +extern void next_record (int); +internal_proto(next_record); /* read.c */ -#define set_integer prefix(set_integer) -void set_integer (void *, int64_t, int); +extern void set_integer (void *, int64_t, int); +internal_proto(set_integer); -#define max_value prefix(max_value) -uint64_t max_value (int, int); +extern uint64_t max_value (int, int); +internal_proto(max_value); -#define convert_real prefix(convert_real) -int convert_real (void *, const char *, int); +extern int convert_real (void *, const char *, int); +internal_proto(convert_real); -#define read_a prefix(read_a) -void read_a (fnode *, char *, int); +extern void read_a (fnode *, char *, int); +internal_proto(read_a); -#define read_f prefix(read_f) -void read_f (fnode *, char *, int); +extern void read_f (fnode *, char *, int); +internal_proto(read_f); -#define read_l prefix(read_l) -void read_l (fnode *, char *, int); +extern void read_l (fnode *, char *, int); +internal_proto(read_l); -#define read_x prefix(read_x) -void read_x (fnode *); +extern void read_x (fnode *); +internal_proto(read_x); -#define read_radix prefix(read_radix) -void read_radix (fnode *, char *, int, int); +extern void read_radix (fnode *, char *, int, int); +internal_proto(read_radix); -#define read_decimal prefix(read_decimal) -void read_decimal (fnode *, char *, int); +extern void read_decimal (fnode *, char *, int); +internal_proto(read_decimal); /* list_read.c */ -#define list_formatted_read prefix(list_formatted_read) -void list_formatted_read (bt, void *, int); +extern void list_formatted_read (bt, void *, int); +internal_proto(list_formatted_read); -#define finish_list_read prefix(finish_list_read) -void finish_list_read (void); +extern void finish_list_read (void); +internal_proto(finish_list_read); -#define init_at_eol prefix(init_at_eol) -void init_at_eol(); +extern void init_at_eol(); +internal_proto(init_at_eol); -#define namelist_read prefix(namelist_read) -void namelist_read(); +extern void namelist_read(); +internal_proto(namelist_read); -#define namelist_write prefix(namelist_write) -void namelist_write(); +extern void namelist_write(); +internal_proto(namelist_write); /* write.c */ -#define write_a prefix(write_a) -void write_a (fnode *, const char *, int); - -#define write_b prefix(write_b) -void write_b (fnode *, const char *, int); - -#define write_d prefix(write_d) -void write_d (fnode *, const char *, int); - -#define write_e prefix(write_e) -void write_e (fnode *, const char *, int); - -#define write_en prefix(write_en) -void write_en (fnode *, const char *, int); +extern void write_a (fnode *, const char *, int); +internal_proto(write_a); -#define write_es prefix(write_es) -void write_es (fnode *, const char *, int); +extern void write_b (fnode *, const char *, int); +internal_proto(write_b); -#define write_f prefix(write_f) -void write_f (fnode *, const char *, int); +extern void write_d (fnode *, const char *, int); +internal_proto(write_d); -#define write_i prefix(write_i) -void write_i (fnode *, const char *, int); +extern void write_e (fnode *, const char *, int); +internal_proto(write_e); -#define write_l prefix(write_l) -void write_l (fnode *, char *, int); +extern void write_en (fnode *, const char *, int); +internal_proto(write_en); -#define write_o prefix(write_o) -void write_o (fnode *, const char *, int); +extern void write_es (fnode *, const char *, int); +internal_proto(write_es); -#define write_x prefix(write_x) -void write_x (fnode *); +extern void write_f (fnode *, const char *, int); +internal_proto(write_f); -#define write_z prefix(write_z) -void write_z (fnode *, const char *, int); +extern void write_i (fnode *, const char *, int); +internal_proto(write_i); -#define list_formatted_write prefix(list_formatted_write) -void list_formatted_write (bt, void *, int); +extern void write_l (fnode *, char *, int); +internal_proto(write_l); +extern void write_o (fnode *, const char *, int); +internal_proto(write_o); -#define st_open prefix(st_open) -#define st_close prefix(st_close) -#define st_inquire prefix(st_inquire) -#define st_iolength prefix(st_iolength) -#define st_iolength_done prefix(st_iolength_done) -#define st_rewind prefix(st_rewind) -#define st_read prefix(st_read) -#define st_read_done prefix(st_read_done) -#define st_write prefix(st_write) -#define st_write_done prefix(st_write_done) -#define st_backspace prefix(st_backspace) -#define st_endfile prefix(st_endfile) +extern void write_x (fnode *); +internal_proto(write_x); +extern void write_z (fnode *, const char *, int); +internal_proto(write_z); -void __MAIN (void); +extern void list_formatted_write (bt, void *, int); +internal_proto(list_formatted_write); #endif diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c index 8daf1aa..f0f8ddf 100644 --- a/libgfortran/io/lock.c +++ b/libgfortran/io/lock.c @@ -24,9 +24,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" #include "io.h" -st_parameter ioparm; -namelist_info * ionml; -global_t g; +st_parameter ioparm = { }; +iexport_data(ioparm); + +namelist_info *ionml = 0; +global_t g = { }; /* library_start()-- Called with a library call is entered. */ @@ -37,11 +39,10 @@ library_start (void) if (g.in_library) internal_error ("Recursive library calls not allowed"); -/* The in_library flag indicates whether we're currently processing a - * library call. Some calls leave immediately, but READ and WRITE - * processing return control to the caller but are still considered to - * stay within the library. */ - + /* The in_library flag indicates whether we're currently processing a + library call. Some calls leave immediately, but READ and WRITE + processing return control to the caller but are still considered to + stay within the library. */ g.in_library = 1; if (ioparm.iostat != NULL && ioparm.library_return == LIBRARY_OK) @@ -52,7 +53,7 @@ library_start (void) /* library_end()-- Called when a library call is complete in order to - * clean up for the next call. */ + clean up for the next call. */ void library_end (void) diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 28a6bab..6991c38 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -410,6 +410,9 @@ already_open (gfc_unit * u, unit_flags * flags) /* Open file. */ +extern void st_open (void); +export_proto(st_open); + void st_open (void) { diff --git a/libgfortran/io/rewind.c b/libgfortran/io/rewind.c index b6363dc..bfc2bc4 100644 --- a/libgfortran/io/rewind.c +++ b/libgfortran/io/rewind.c @@ -1,4 +1,3 @@ - /* Copyright (C) 2002-2003 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -25,6 +24,9 @@ Boston, MA 02111-1307, USA. */ /* rewind.c-- Implement the rewind statement */ +extern void st_rewind (void); +export_proto(st_rewind); + void st_rewind (void) { diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index ec5240d..9822a76 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -53,10 +53,25 @@ Boston, MA 02111-1307, USA. */ st_write(), an error inhibits any data from actually being transferred. */ -gfc_unit *current_unit; +extern void transfer_integer (void *, int); +export_proto(transfer_integer); + +extern void transfer_real (void *, int); +export_proto(transfer_real); + +extern void transfer_logical (void *, int); +export_proto(transfer_logical); + +extern void transfer_character (void *, int); +export_proto(transfer_character); + +extern void transfer_complex (void *, int); +export_proto(transfer_complex); + +gfc_unit *current_unit = NULL; static int sf_seen_eor = 0; -char scratch[SCRATCH_SIZE]; +char scratch[SCRATCH_SIZE] = { }; static char *line_buffer = NULL; static unit_advance advance_status; @@ -1433,6 +1448,9 @@ iolength_transfer_init (void) it must still be a runtime library call so that we can determine the iolength for dynamic arrays and such. */ +extern void st_iolength (void); +export_proto(st_iolength); + void st_iolength (void) { @@ -1440,6 +1458,9 @@ st_iolength (void) iolength_transfer_init (); } +extern void st_iolength_done (void); +export_proto(st_iolength_done); + void st_iolength_done (void) { @@ -1449,6 +1470,9 @@ st_iolength_done (void) /* The READ statement. */ +extern void st_read (void); +export_proto(st_read); + void st_read (void) { @@ -1481,6 +1505,8 @@ st_read (void) } } +extern void st_read_done (void); +export_proto(st_read_done); void st_read_done (void) @@ -1489,6 +1515,8 @@ st_read_done (void) library_end (); } +extern void st_write (void); +export_proto(st_write); void st_write (void) @@ -1497,6 +1525,8 @@ st_write (void) data_transfer_init (0); } +extern void st_write_done (void); +export_proto(st_write_done); void st_write_done (void) @@ -1567,6 +1597,21 @@ st_set_nml_var (void * var_addr, char * var_name, int var_name_len, } } +extern void st_set_nml_var_int (void *, char *, int, int); +export_proto(st_set_nml_var_int); + +extern void st_set_nml_var_float (void *, char *, int, int); +export_proto(st_set_nml_var_float); + +extern void st_set_nml_var_char (void *, char *, int, int, gfc_charlen_type); +export_proto(st_set_nml_var_char); + +extern void st_set_nml_var_complex (void *, char *, int, int); +export_proto(st_set_nml_var_complex); + +extern void st_set_nml_var_log (void *, char *, int, int); +export_proto(st_set_nml_var_log); + void st_set_nml_var_int (void * var_addr, char * var_name, int var_name_len, int kind) diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 3732707..c259e56 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -76,10 +76,85 @@ typedef off_t gfc_offset; #define __attribute__(x) #endif -/* For a library, a standard prefix is a requirement in order to - partition the namespace. It's ugly to look at and a pain to type, - so we hide it behind macros. */ -#define prefix(x) _gfortran_ ## x +/* For a library, a standard prefix is a requirement in order to partition + the namespace. IPREFIX is for symbols intended to be internal to the + library. */ +#define PREFIX(x) _gfortran_ ## x +#define IPREFIX(x) _gfortrani_ ## x + +/* Magic to rename a symbol at the compiler level. You continue to refer + to the symbol as OLD in the source, but it'll be named NEW in the asm. */ +#define sym_rename(old, new) sym_rename1(old, __USER_LABEL_PREFIX__, new) +#define sym_rename1(old, ulp, new) sym_rename2(old, ulp, new) +#define sym_rename2(old, ulp, new) extern __typeof(old) old __asm__(#ulp #new) + +/* There are several classifications of routines: + + (1) Symbols used only within the library, + (2) Symbols to be exported from the library, + (3) Symbols to be exported from the library, but + also used inside the library. + + By telling the compiler about these different classifications we can + tightly control the interface seen by the user, and get better code + from the compiler at the same time. + + One of the following should be used immediately after the declaration + of each symbol: + + internal_proto Marks a symbol used only within the library, + and adds IPREFIX to the assembly-level symbol + name. The later is important for maintaining + the namespace partition for the static library. + + export_proto Marks a symbol to be exported, and adds PREFIX + to the assembly-level symbol name. + + export_proto_np Marks a symbol to be exported without adding PREFIX. + + iexport_proto Marks a function to be exported, but with the + understanding that it can be used inside as well. + + iexport_data_proto Similarly, marks a data symbol to be exported. + Unfortunately, some systems can't play the hidden + symbol renaming trick on data symbols, thanks to + the horribleness of COPY relocations. + + If iexport_proto or iexport_data_proto is used, you must also use + iexport or iexport_data after the *definition* of the symbol. */ + +#if defined(HAVE_ATTRIBUTE_VISIBILITY) +# define internal_proto(x) \ + sym_rename(x, IPREFIX (x)) __attribute__((__visibility__("hidden"))) +#else +# define internal_proto(x) sym_rename(x, IPREFIX(x)) +#endif + +#if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS) +# define export_proto(x) sym_rename(x, PREFIX(x)) +# define export_proto_np(x) extern char swallow_semicolon +# define iexport_proto(x) internal_proto(x) +# define iexport(x) iexport1(x, __USER_LABEL_PREFIX__, IPREFIX(x)) +# define iexport1(x,p,y) iexport2(x,p,y) +# define iexport2(x,p,y) \ + extern __typeof(x) PREFIX(x) __attribute__((__alias__(#p #y))) +/* ??? We're not currently building a dll, and it's wrong to add dllexport + to objects going into a static library archive. */ +#elif 0 && defined(HAVE_ATTRIBUTE_DLLEXPORT) +# define export_proto_np(x) extern __typeof(x) x __attribute__((dllexport)) +# define export_proto(x) sym_rename(x, PREFIX(x)) __attribute__((dllexport)) +# define iexport_proto(x) export_proto(x) +# define iexport(x) extern char swallow_semicolon +#else +# define export_proto(x) sym_rename(x, PREFIX(x)) +# define export_proto_np(x) extern char swallow_semicolon +# define iexport_proto(x) export_proto(x) +# define iexport(x) extern char swallow_semicolon +#endif + +/* TODO: detect the case when we *can* hide the symbol. */ +#define iexport_data_proto(x) export_proto(x) +#define iexport_data(x) extern char swallow_semicolon /* The only reliable way to get the offset of a field in a struct in a system independent way is via this macro. */ @@ -129,8 +204,8 @@ typedef size_t index_type; typedef GFC_INTEGER_4 gfc_charlen_type; /* This will be 0 on little-endian machines and one on big-endian machines. */ -#define l8_to_l4_offset prefix(l8_to_l4_offset) extern int l8_to_l4_offset; +internal_proto(l8_to_l4_offset); #define GFOR_POINTER_L8_TO_L4(p8) \ (l8_to_l4_offset + (GFC_LOGICAL_4 *)(p8)) @@ -224,8 +299,8 @@ typedef struct options_t; -#define options prefix(options) extern options_t options; +internal_proto(options); /* Structure for statement options. */ @@ -265,204 +340,171 @@ error_codes; /* The filename and line number don't go inside the globals structure. They are set by the rest of the program and must be linked to. */ -#define line prefix(line) -extern unsigned line; /* Location of the current libray call (optional). */ +/* Location of the current library call (optional). */ +extern unsigned line; +iexport_data_proto(line); -#define filename prefix(filename) extern char *filename; +iexport_data_proto(filename); /* Avoid conflicting prototypes of alloca() in system headers by using GCC's builtin alloca(). */ - #define gfc_alloca(x) __builtin_alloca(x) /* main.c */ -#define library_start prefix(library_start) -void library_start (void); - -#define library_end prefix(library_end) -void library_end (void); +extern void library_start (void); +internal_proto(library_start); -#define set_args prefix(set_args) -void set_args (int, char **); +extern void library_end (void); +internal_proto(library_end); -#define get_args prefix(get_args) -void get_args (int *, char ***); +extern void set_args (int, char **); +export_proto(set_args); +extern void get_args (int *, char ***); +internal_proto(get_args); /* error.c */ -#define itoa prefix(itoa) -char *itoa (int64_t); - -#define xtoa prefix(xtoa) -char *xtoa (uint64_t); -#define os_error prefix(os_error) -void os_error (const char *) __attribute__ ((noreturn)); +extern char *itoa (int64_t); +internal_proto(itoa); -#define show_locus prefix(show_locus) -void show_locus (void); +extern char *xtoa (uint64_t); +internal_proto(xtoa); -#define runtime_error prefix(runtime_error) -void runtime_error (const char *) __attribute__ ((noreturn)); +extern void os_error (const char *) __attribute__ ((noreturn)); +internal_proto(os_error); -#define internal_error prefix(internal_error) -void internal_error (const char *) __attribute__ ((noreturn)); +extern void show_locus (void); +internal_proto(show_locus); -#define get_oserror prefix(get_oserror) -const char *get_oserror (void); +extern void runtime_error (const char *) __attribute__ ((noreturn)); +iexport_proto(runtime_error); -#define write_error prefix(write_error) -void write_error (const char *); +extern void internal_error (const char *) __attribute__ ((noreturn)); +internal_proto(internal_error); -#define sys_exit prefix(sys_exit) -void sys_exit (int) __attribute__ ((noreturn)); +extern const char *get_oserror (void); +internal_proto(get_oserror); -#define st_printf prefix(st_printf) -int st_printf (const char *, ...) __attribute__ ((format (printf, 1, 2))); +extern void sys_exit (int) __attribute__ ((noreturn)); +internal_proto(sys_exit); -#define st_sprintf prefix(st_sprintf) -void st_sprintf (char *, const char *, ...) __attribute__ ((format (printf, 2, 3))); +extern int st_printf (const char *, ...) + __attribute__ ((format (printf, 1, 2))); +internal_proto(st_printf); -#define translate_error prefix(translate_error) -const char *translate_error (int); +extern void st_sprintf (char *, const char *, ...) + __attribute__ ((format (printf, 2, 3))); +internal_proto(st_sprintf); -#define generate_error prefix(generate_error) -void generate_error (int, const char *); +extern const char *translate_error (int); +internal_proto(translate_error); +extern void generate_error (int, const char *); +internal_proto(generate_error); /* memory.c */ -#define memory_init prefix(memory_init) -void memory_init (void); - -#define runtime_cleanup prefix(runtime_cleanup) -void runtime_cleanup (void); - -#define get_mem prefix(get_mem) -void *get_mem (size_t) __attribute__ ((malloc)); - -#define free_mem prefix(free_mem) -void free_mem (void *); - -#define internal_malloc_size prefix(internal_malloc_size) -void *internal_malloc_size (size_t); - -#define internal_malloc prefix(internal_malloc) -void *internal_malloc (GFC_INTEGER_4); - -#define internal_malloc64 prefix(internal_malloc64) -void *internal_malloc64 (GFC_INTEGER_8); +extern void *get_mem (size_t) __attribute__ ((malloc)); +internal_proto(get_mem); -#define internal_free prefix(internal_free) -void internal_free (void *); +extern void free_mem (void *); +internal_proto(free_mem); -#define allocate prefix(allocate) -void allocate (void **, GFC_INTEGER_4, GFC_INTEGER_4 *); - -#define allocate64 prefix(allocate64) -void allocate64 (void **, GFC_INTEGER_8, GFC_INTEGER_4 *); - -#define deallocate prefix(deallocate) -void deallocate (void **, GFC_INTEGER_4 *); +extern void *internal_malloc_size (size_t); +internal_proto(internal_malloc_size); +extern void internal_free (void *); +iexport_proto(internal_free); /* environ.c */ -#define check_buffered prefix(check_buffered) -int check_buffered (int); - -#define init_variables prefix(init_variables) -void init_variables (void); +extern int check_buffered (int); +internal_proto(check_buffered); -#define show_variables prefix(show_variables) -void show_variables (void); +extern void init_variables (void); +internal_proto(init_variables); +extern void show_variables (void); +internal_proto(show_variables); /* string.c */ -#define find_option prefix(find_option) -int find_option (const char *, int, st_option *, const char *); +extern int find_option (const char *, int, st_option *, const char *); +internal_proto(find_option); -#define fstrlen prefix(fstrlen) -int fstrlen (const char *, int); +extern int fstrlen (const char *, int); +internal_proto(fstrlen); -#define fstrcpy prefix(fstrcpy) -void fstrcpy (char *, int, const char *, int); +extern void fstrcpy (char *, int, const char *, int); +internal_proto(fstrcpy); -#define cf_strcpy prefix(cf_strcpy) -void cf_strcpy (char *, int, const char *); +extern void cf_strcpy (char *, int, const char *); +internal_proto(cf_strcpy); /* io.c */ -#define init_units prefix(init_units) -void init_units (void); +extern void init_units (void); +internal_proto(init_units); -#define close_units prefix(close_units) -void close_units (void); +extern void close_units (void); +internal_proto(close_units); /* stop.c */ -#define stop_numeric prefix(stop_numeric) -void stop_numeric (GFC_INTEGER_4); + +extern void stop_numeric (GFC_INTEGER_4); +iexport_proto(stop_numeric); /* reshape_packed.c */ -#define reshape_packed prefix(reshape_packed) -void reshape_packed (char *, index_type, const char *, index_type, - const char *, index_type); -/* Repacking functions. */ -#define internal_pack prefix(internal_pack) -void *internal_pack (gfc_array_char *); +extern void reshape_packed (char *, index_type, const char *, index_type, + const char *, index_type); +internal_proto(reshape_packed); -#define internal_unpack prefix(internal_unpack) -void internal_unpack (gfc_array_char *, const void *); +/* Repacking functions. */ -#define internal_pack_4 prefix(internal_pack_4) +/* ??? These four aren't currently used by the compiler, though we + certainly could do so. */ GFC_INTEGER_4 *internal_pack_4 (gfc_array_i4 *); +internal_proto(internal_pack_4); -#define internal_pack_8 prefix(internal_pack_8) GFC_INTEGER_8 *internal_pack_8 (gfc_array_i8 *); +internal_proto(internal_pack_8); -#define internal_unpack_4 prefix(internal_unpack_4) -void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *); - -#define internal_unpack_8 prefix(internal_unpack_8) -void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *); +extern void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *); +internal_proto(internal_unpack_4); -/* date_and_time.c */ - -#define date_and_time prefix(date_and_time) -void date_and_time (char *, char *, char *, gfc_array_i4 *, - GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4); +extern void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *); +internal_proto(internal_unpack_8); /* string_intrinsics.c */ -#define compare_string prefix(compare_string) -GFC_INTEGER_4 compare_string (GFC_INTEGER_4, const char *, - GFC_INTEGER_4, const char *); +extern GFC_INTEGER_4 compare_string (GFC_INTEGER_4, const char *, + GFC_INTEGER_4, const char *); +iexport_proto(compare_string); /* random.c */ -#define random_seed prefix(random_seed) -void random_seed (GFC_INTEGER_4 * size, gfc_array_i4 * put, - gfc_array_i4 * get); +extern void random_seed (GFC_INTEGER_4 * size, gfc_array_i4 * put, + gfc_array_i4 * get); +iexport_proto(random_seed); /* normalize.c */ -#define normalize_r4_i4 prefix(normalize_r4_i4) -GFC_REAL_4 normalize_r4_i4 (GFC_UINTEGER_4, GFC_UINTEGER_4); +extern GFC_REAL_4 normalize_r4_i4 (GFC_UINTEGER_4, GFC_UINTEGER_4); +internal_proto(normalize_r4_i4); -#define normalize_r8_i8 prefix(normalize_r8_i8) -GFC_REAL_8 normalize_r8_i8 (GFC_UINTEGER_8, GFC_UINTEGER_8); +extern GFC_REAL_8 normalize_r8_i8 (GFC_UINTEGER_8, GFC_UINTEGER_8); +internal_proto(normalize_r8_i8); /* size.c */ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t; -#define size0 prefix(size0) -index_type size0 (const array_t * array); +extern index_type size0 (const array_t * array); +iexport_proto(size0); #endif /* LIBGFOR_H */ - diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4 index 46ae7ce..989f91c 100644 --- a/libgfortran/m4/cshift1.m4 +++ b/libgfortran/m4/cshift1.m4 @@ -26,9 +26,15 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h"' include(iparm.m4)dnl +void __cshift1_`'atype_kind (const gfc_array_char * ret, + const gfc_array_char * array, + const atype * h, const atype_name * pwhich); +export_proto_np(__cshift1_`'atype_kind); + void -`__cshift1_'atype_kind (const gfc_array_char * ret, const gfc_array_char * array, - const atype * h, const atype_name * pwhich) +__cshift1_`'atype_kind (const gfc_array_char * ret, + const gfc_array_char * array, + const atype * h, const atype_name * pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -42,7 +48,7 @@ void index_type soffset; const char *sptr; const char *src; -` /* h.* indicates the shift array. */' + /* h.* indicates the shift array. */ index_type hstride[GFC_MAX_DIMENSIONS - 1]; index_type hstride0; const atype_name *hptr; @@ -71,7 +77,7 @@ void size = GFC_DESCRIPTOR_SIZE (array); n = 0; -`/* Initialized for avoiding compiler warnings. */' + /* Initialized for avoiding compiler warnings. */ roffset = size; soffset = size; len = 0; @@ -116,7 +122,7 @@ void while (rptr) { -` /* Do the shift for this dimension. */' + /* Do the shift for this dimension. */ sh = *hptr; sh = (div (sh, len)).rem; if (sh < 0) @@ -168,4 +174,3 @@ void } } } - diff --git a/libgfortran/m4/dotprod.m4 b/libgfortran/m4/dotprod.m4 index bde4c20..3e3245c 100644 --- a/libgfortran/m4/dotprod.m4 +++ b/libgfortran/m4/dotprod.m4 @@ -27,9 +27,12 @@ include(iparm.m4)dnl typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern rtype_name __dot_product_`'rtype_code (rtype * a, rtype * b); +export_proto_np(__dot_product_`'rtype_code); + /* Both parameters will already have been converted to the result type. */ rtype_name -`__dot_product_'rtype_code (rtype * a, rtype * b) +__dot_product_`'rtype_code (rtype * a, rtype * b) { rtype_name *pa; rtype_name *pb; @@ -63,4 +66,3 @@ sinclude(`dotprod_asm_'rtype_code`.m4')dnl return res; } - diff --git a/libgfortran/m4/dotprodc.m4 b/libgfortran/m4/dotprodc.m4 index eb97efa..38ef7fc 100644 --- a/libgfortran/m4/dotprodc.m4 +++ b/libgfortran/m4/dotprodc.m4 @@ -28,9 +28,12 @@ include(iparm.m4)dnl typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array; +extern rtype_name __dot_product_`'rtype_code (rtype * a, rtype * b); +export_proto_np(__dot_product_`'rtype_code); + /* Both parameters will already have been converted to the result type. */ rtype_name -`__dot_product_'rtype_code (rtype * a, rtype * b) +__dot_product_`'rtype_code (rtype * a, rtype * b) { rtype_name *pa; rtype_name *pb; @@ -66,4 +69,3 @@ sinclude(`dotprod_asm_'rtype_code`.m4')dnl return res; } - diff --git a/libgfortran/m4/dotprodl.m4 b/libgfortran/m4/dotprodl.m4 index 8f886d3..dc196e0 100644 --- a/libgfortran/m4/dotprodl.m4 +++ b/libgfortran/m4/dotprodl.m4 @@ -25,8 +25,11 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h"' include(iparm.m4)dnl +extern rtype_name __dot_product_`'rtype_code (gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(__dot_product_`'rtype_code); + rtype_name -`__dot_product_'rtype_code (gfc_array_l4 * a, gfc_array_l4 * b) +__dot_product_`'rtype_code (gfc_array_l4 * a, gfc_array_l4 * b) { GFC_LOGICAL_4 *pa; GFC_LOGICAL_4 *pb; @@ -72,4 +75,3 @@ rtype_name return 0; } - diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4 index a7852e0..f8ae460 100644 --- a/libgfortran/m4/eoshift1.m4 +++ b/libgfortran/m4/eoshift1.m4 @@ -29,9 +29,17 @@ include(iparm.m4)dnl static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift1_`'atype_kind (const gfc_array_char *, + const gfc_array_char *, + const atype *, const char *, + const atype_name *); +export_proto_np(__eoshift1_`'atype_kind); + void -`__eoshift1_'atype_kind (const gfc_array_char * ret, const gfc_array_char * array, - const atype * h, const char * pbound, const atype_name * pwhich) +__eoshift1_`'atype_kind (const gfc_array_char *ret, + const gfc_array_char *array, + const atype *h, const char *pbound, + const atype_name *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -176,4 +184,3 @@ void } } } - diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4 index a540752..4e706dc 100644 --- a/libgfortran/m4/eoshift3.m4 +++ b/libgfortran/m4/eoshift3.m4 @@ -29,9 +29,15 @@ include(iparm.m4)dnl static const char zeros[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +extern void __eoshift3_`'atype_kind (gfc_array_char *, gfc_array_char *, + atype *, const gfc_array_char *, + atype_name *); +export_proto_np(__eoshift3_`'atype_kind); + void -`__eoshift3_'atype_kind (gfc_array_char * ret, gfc_array_char * array, - atype * h, const gfc_array_char * bound, atype_name * pwhich) +__eoshift3_`'atype_kind (gfc_array_char *ret, gfc_array_char *array, + atype *h, const gfc_array_char *bound, + atype_name *pwhich) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS - 1]; @@ -191,4 +197,3 @@ void } } } - diff --git a/libgfortran/m4/exponent.m4 b/libgfortran/m4/exponent.m4 index 510f763..a0e31e3 100644 --- a/libgfortran/m4/exponent.m4 +++ b/libgfortran/m4/exponent.m4 @@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */ include(`mtype.m4')dnl +extern GFC_INTEGER_4 exponent_r`'kind (real_type s); +export_proto(exponent_r`'kind); + GFC_INTEGER_4 -prefix(exponent_r`'kind) (real_type s) +exponent_r`'kind (real_type s) { int ret; frexp`'q (s, &ret); diff --git a/libgfortran/m4/fraction.m4 b/libgfortran/m4/fraction.m4 index c453e78..dd71865 100644 --- a/libgfortran/m4/fraction.m4 +++ b/libgfortran/m4/fraction.m4 @@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */ include(`mtype.m4')dnl +extern real_type fraction_r`'kind (real_type s); +export_proto(fraction_r`'kind); + real_type -prefix(fraction_r`'kind) (real_type s) +fraction_r`'kind (real_type s) { int dummy_exp; return frexp`'q (s, &dummy_exp); diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4 index 4106ddc..b67770b 100644 --- a/libgfortran/m4/iforeach.m4 +++ b/libgfortran/m4/iforeach.m4 @@ -3,7 +3,11 @@ dnl Contains the generic sections of the array functions. dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran) dnl Distributed under the GNU LGPL. See COPYING for details. define(START_FOREACH_FUNCTION, -`void +` +extern void `__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array); +export_proto_np(`__'name`'rtype_qual`_'atype_code); + +void `__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array) { index_type count[GFC_MAX_DIMENSIONS]; @@ -85,7 +89,11 @@ define(FINISH_FOREACH_FUNCTION, } }')dnl define(START_MASKED_FOREACH_FUNCTION, -`void +` +extern void `__m'name`'rtype_qual`_'atype_code (rtype *, atype *, gfc_array_l4 *); +export_proto_np(`__m'name`'rtype_qual`_'atype_code); + +void `__m'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array, gfc_array_l4 * mask) { index_type count[GFC_MAX_DIMENSIONS]; diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4 index 93b3197..0a377a5 100644 --- a/libgfortran/m4/ifunction.m4 +++ b/libgfortran/m4/ifunction.m4 @@ -18,8 +18,12 @@ dnl Execution should be allowed to continue to the end of the block. dnl You should not return or break from the inner loop of the implementation. dnl Care should also be taken to avoid using the names defined in iparm.m4 define(START_ARRAY_FUNCTION, -`void -`__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array, index_type *pdim) +` +extern void `__'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *); +export_proto_np(`__'name`'rtype_qual`_'atype_code); + +void +`__'name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim) { index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; @@ -138,7 +142,12 @@ define(FINISH_ARRAY_FUNCTION, } }')dnl define(START_MASKED_ARRAY_FUNCTION, -`void +` +extern void `__m'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *, + gfc_array_l4 *); +export_proto_np(`__m'name`'rtype_qual`_'atype_code); + +void `__m'name`'rtype_qual`_'atype_code (rtype * retarray, atype * array, index_type *pdim, gfc_array_l4 * mask) { index_type count[GFC_MAX_DIMENSIONS - 1]; diff --git a/libgfortran/m4/matmul.m4 b/libgfortran/m4/matmul.m4 index 9af77ce..ef631d3 100644 --- a/libgfortran/m4/matmul.m4 +++ b/libgfortran/m4/matmul.m4 @@ -38,6 +38,9 @@ include(iparm.m4)dnl C(I,J) = C(I,J)+A(I,K)*B(K,J) */ +extern void `__matmul_'rtype_code (rtype * retarray, rtype * a, rtype * b); +export_proto_np(`__matmul_'rtype_code); + void `__matmul_'rtype_code (rtype * retarray, rtype * a, rtype * b) { diff --git a/libgfortran/m4/matmull.m4 b/libgfortran/m4/matmull.m4 index 0d66a42..4091ef6 100644 --- a/libgfortran/m4/matmull.m4 +++ b/libgfortran/m4/matmull.m4 @@ -27,6 +27,10 @@ include(iparm.m4)dnl /* Dimensions: retarray(x,y) a(x, count) b(count,y). Either a or b can be rank 1. In this case x or y is 1. */ + +extern void `__matmul_'rtype_code (rtype *, gfc_array_l4 *, gfc_array_l4 *); +export_proto_np(`__matmul_'rtype_code); + void `__matmul_'rtype_code (rtype * retarray, gfc_array_l4 * a, gfc_array_l4 * b) { diff --git a/libgfortran/m4/nearest.m4 b/libgfortran/m4/nearest.m4 index 5168d99..54b8550 100644 --- a/libgfortran/m4/nearest.m4 +++ b/libgfortran/m4/nearest.m4 @@ -24,8 +24,11 @@ Boston, MA 02111-1307, USA. */ include(`mtype.m4')dnl +extern real_type nearest_r`'kind (real_type s, real_type dir); +export_proto(nearest_r`'kind); + real_type -prefix(nearest_r`'kind) (real_type s, real_type dir) +nearest_r`'kind (real_type s, real_type dir) { dir = copysign`'q (__builtin_inf`'q (), dir); if (FLT_EVAL_METHOD != 0) diff --git a/libgfortran/m4/pow.m4 b/libgfortran/m4/pow.m4 index 4bf453a..724cebe 100644 --- a/libgfortran/m4/pow.m4 +++ b/libgfortran/m4/pow.m4 @@ -23,13 +23,16 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h"' include(iparm.m4)dnl -/* Uuse Binary Method to calculate the powi. This is not an optimal but +/* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ +rtype_name `pow_'rtype_code`_'atype_code (rtype_name a, atype_name b); +export_proto(pow_`'rtype_code`_'atype_code); + rtype_name -`prefix(pow_'rtype_code`_'atype_code) (rtype_name a, atype_name b) +`pow_'rtype_code`_'atype_code (rtype_name a, atype_name b) { rtype_name pow, x; atype_name n, u; diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4 index 7400f31..7355a7a 100644 --- a/libgfortran/m4/reshape.m4 +++ b/libgfortran/m4/reshape.m4 @@ -30,6 +30,11 @@ typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type; /* The shape parameter is ignored. We can currently deduce the shape from the return array. */ dnl Only the kind (ie size) is used to name the function. + +extern void `__reshape_'rtype_kind (rtype *, rtype *, shape_type *, + rtype *, shape_type *); +extern_proto_np(`__reshape_'rtype_kind); + void `__reshape_'rtype_kind (rtype * ret, rtype * source, shape_type * shape, rtype * pad, shape_type * order) @@ -224,4 +229,3 @@ void } } } - diff --git a/libgfortran/m4/set_exponent.m4 b/libgfortran/m4/set_exponent.m4 index 352a129..00ea8b0 100644 --- a/libgfortran/m4/set_exponent.m4 +++ b/libgfortran/m4/set_exponent.m4 @@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */ include(`mtype.m4')dnl +extern real_type set_exponent_r`'kind (real_type s, GFC_INTEGER_4 i); +export_proto(set_exponent_r`'kind); + real_type -prefix(set_exponent_r`'kind) (real_type s, GFC_INTEGER_4 i) +set_exponent_r`'kind (real_type s, GFC_INTEGER_4 i) { int dummy_exp; return scalbn`'q (frexp`'q (s, &dummy_exp), i); diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4 index 6c58658..e10fe0c 100644 --- a/libgfortran/m4/shape.m4 +++ b/libgfortran/m4/shape.m4 @@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h"' include(iparm.m4)dnl +extern void `__shape_'rtype_kind (rtype * ret, const rtype * array); +export_proto_np(`__shape_'rtype_kind); + void `__shape_'rtype_kind (rtype * ret, const rtype * array) { @@ -41,4 +44,3 @@ void array->dim[n].ubound + 1 - array->dim[n].lbound; } } - diff --git a/libgfortran/m4/transpose.m4 b/libgfortran/m4/transpose.m4 index 55f4b57..e519b29 100644 --- a/libgfortran/m4/transpose.m4 +++ b/libgfortran/m4/transpose.m4 @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h"' include(iparm.m4)dnl +extern void `__transpose_'rtype_kind (rtype * ret, rtype * source); +export_proto_np(`__transpose_'rtype_kind); + void `__transpose_'rtype_kind (rtype * ret, rtype * source) { diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c index dc6e590..02831f1 100644 --- a/libgfortran/runtime/environ.c +++ b/libgfortran/runtime/environ.c @@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */ * but other variables are checked during execution of the user's * program. */ -options_t options; +options_t options = { }; extern char **environ; diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 913812c..2ccaff0 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -48,8 +48,11 @@ Boston, MA 02111-1307, USA. */ * that files that report loci and those that do not can be linked * together without reporting an erroneous position. */ -char *filename; -unsigned line; +char *filename = 0; +iexport_data(filename); + +unsigned line = 0; +iexport_data(line); static char buffer[32]; /* buffer for integer/ascii conversions */ @@ -332,6 +335,7 @@ runtime_error (const char *message) st_printf ("Fortran runtime error: %s\n", message); sys_exit (2); } +iexport(runtime_error); /* void internal_error()-- These are this-can't-happen errors diff --git a/libgfortran/runtime/in_pack_generic.c b/libgfortran/runtime/in_pack_generic.c index fefac07..7849a58 100644 --- a/libgfortran/runtime/in_pack_generic.c +++ b/libgfortran/runtime/in_pack_generic.c @@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +extern void *internal_pack (gfc_array_char *); +export_proto(internal_pack); + void * internal_pack (gfc_array_char * source) { diff --git a/libgfortran/runtime/in_unpack_generic.c b/libgfortran/runtime/in_unpack_generic.c index d468e74..313a79f 100644 --- a/libgfortran/runtime/in_unpack_generic.c +++ b/libgfortran/runtime/in_unpack_generic.c @@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ #include <string.h> #include "libgfortran.h" +extern void internal_unpack (gfc_array_char *, const void *); +export_proto(internal_unpack); + void internal_unpack (gfc_array_char * d, const void * s) { diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c index 4e1f78c..882946c 100644 --- a/libgfortran/runtime/main.c +++ b/libgfortran/runtime/main.c @@ -29,12 +29,11 @@ Boston, MA 02111-1307, USA. */ /* This is the offset (in bytes) required to cast from logical(8)* to logical(4)*. and still get the same result. Will be 0 for little-endian machines and 4 for big-endian machines. */ -int l8_to_l4_offset; +int l8_to_l4_offset = 0; /* Figure out endianness for this machine. */ -#define detetmine_endianness prefix(determine_endianness) static void determine_endianness (void) { @@ -95,12 +94,10 @@ init (void) if (argc > 1 && strcmp (argv[1], "--help") == 0) show_variables (); -/* if (argc > 1 && strcmp(argv[1], "--resume") == 0) resume(); */ + /* if (argc > 1 && strcmp(argv[1], "--resume") == 0) resume(); */ #endif - memory_init (); random_seed(NULL,NULL,NULL); - } diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c index 2280848..71bad9f 100644 --- a/libgfortran/runtime/memory.c +++ b/libgfortran/runtime/memory.c @@ -37,7 +37,6 @@ Boston, MA 02111-1307, USA. */ the memory we allocate internally. We could also use this for user allocated memory (ALLOCATE/DEALLOCATE). This should be stored in a seperate list. */ -#define malloc_t prefix(malloc_t) typedef struct malloc_t { int magic; @@ -59,31 +58,25 @@ malloc_t; /* The root of the circular double linked list for compiler generated malloc calls. */ -static malloc_t mem_root; - - -void -memory_init (void) -{ - /* The root should never be used directly, so don't set the magic. */ - mem_root.magic = 0; - mem_root.next = &mem_root; - mem_root.prev = &mem_root; - mem_root.marker = 0; -} - - +static malloc_t mem_root = { + .next = &mem_root, + .prev = &mem_root +}; + +#if 0 +/* ??? Disabled because, well, it wasn't being called before transforming + it to a destructor, and turning it on causes testsuite failures. */ /* Doesn't actually do any cleaning up, just throws an error if something has got out of sync somewhere. */ -void +static void __attribute__((destructor)) runtime_cleanup (void) { /* Make sure all memory we've allocated is freed on exit. */ if (mem_root.next != &mem_root) runtime_error ("Unfreed memory on program termination"); } - +#endif void * @@ -92,13 +85,9 @@ get_mem (size_t n) void *p; #ifdef GFC_CLEAR_MEMORY - p = (void *) calloc (n, 1); + p = (void *) calloc (1, n); #else -#define temp malloc -#undef malloc p = (void *) malloc (n); -#define malloc temp -#undef temp #endif if (p == NULL) os_error ("Memory allocation failed"); @@ -157,6 +146,8 @@ internal_malloc_size (size_t size) return DATA_POINTER (newmem); } +extern void *internal_malloc (GFC_INTEGER_4); +export_proto(internal_malloc); void * internal_malloc (GFC_INTEGER_4 size) @@ -170,6 +161,8 @@ internal_malloc (GFC_INTEGER_4 size) return internal_malloc_size ((size_t) size); } +extern void *internal_malloc64 (GFC_INTEGER_8); +export_proto(internal_malloc64); void * internal_malloc64 (GFC_INTEGER_8 size) @@ -209,6 +202,7 @@ internal_free (void *mem) free (m); } +iexport(internal_free); /* User-allocate, one call for each member of the alloc-list of an @@ -244,6 +238,8 @@ allocate_size (void **mem, size_t size, GFC_INTEGER_4 * stat) *stat = 0; } +extern void allocate (void **, GFC_INTEGER_4, GFC_INTEGER_4 *); +export_proto(allocate); void allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) @@ -258,6 +254,8 @@ allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) allocate_size (mem, (size_t) size, stat); } +extern void allocate64 (void **, GFC_INTEGER_8, GFC_INTEGER_4 *); +export_proto(allocate64); void allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) @@ -276,6 +274,9 @@ allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) /* User-deallocate; pointer is NULLified. */ +extern void deallocate (void **, GFC_INTEGER_4 *); +export_proto(deallocate); + void deallocate (void **mem, GFC_INTEGER_4 * stat) { diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index e2d08be..e6d683b 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -25,9 +25,6 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" -#define pause_numeric prefix(pause_numeric) -#define pause_string prefix(pause_string) - static void do_pause (void) { @@ -42,6 +39,10 @@ do_pause (void) } /* A numeric or blank STOP statement. */ + +extern void pause_numeric (GFC_INTEGER_4 code); +export_proto(pause_numeric); + void pause_numeric (GFC_INTEGER_4 code) { @@ -55,6 +56,8 @@ pause_numeric (GFC_INTEGER_4 code) do_pause (); } +extern void pause_string (char *string, GFC_INTEGER_4 len); +export_proto(pause_string); void pause_string (char *string, GFC_INTEGER_4 len) diff --git a/libgfortran/runtime/select.c b/libgfortran/runtime/select.c index 5ee873a..807845c 100644 --- a/libgfortran/runtime/select.c +++ b/libgfortran/runtime/select.c @@ -30,15 +30,18 @@ typedef struct } select_struct; - -#define select_string prefix(select_string) +extern void * select_string (select_struct *table, int table_len, + void *default_jump, const char *selector, + int selector_len); +export_proto(select_string); /* select_string()-- Given a selector string and a table of * select_struct structures, return the address to jump to. */ -void *select_string (select_struct *table, int table_len, void *default_jump, - const char *selector, int selector_len) +void * +select_string (select_struct *table, int table_len, void *default_jump, + const char *selector, int selector_len) { select_struct *t; int i, low, high, mid; diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index ef8741a..5ae06ec 100644 --- a/libgfortran/runtime/stop.c +++ b/libgfortran/runtime/stop.c @@ -24,8 +24,6 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" -#define stop_string prefix(stop_string) - /* A numeric or blank STOP statement. */ void stop_numeric (GFC_INTEGER_4 code) @@ -39,7 +37,11 @@ stop_numeric (GFC_INTEGER_4 code) sys_exit (code); } +iexport(stop_numeric); + +extern void stop_string (const char *string, GFC_INTEGER_4 len); +export_proto(stop_string); void stop_string (const char *string, GFC_INTEGER_4 len) |