summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-12 08:59:05 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-12 08:59:05 +0000
commit7b6cb5bd2ce5a30c6074488312de984b1c69674a (patch)
treecb0ecd2cd7b8c21d4d1c38261b5b7116e8dd2782 /libgfortran
parent2027d2d27693ee46db98fb7d407b8856d64fb864 (diff)
downloadgcc-7b6cb5bd2ce5a30c6074488312de984b1c69674a.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92045 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog37
-rw-r--r--libgfortran/acinclude.m446
-rw-r--r--libgfortran/config.h.in9
-rwxr-xr-xlibgfortran/configure205
-rw-r--r--libgfortran/configure.ac5
-rw-r--r--libgfortran/generated/all_l4.c6
-rw-r--r--libgfortran/generated/all_l8.c6
-rw-r--r--libgfortran/generated/any_l4.c6
-rw-r--r--libgfortran/generated/any_l8.c6
-rw-r--r--libgfortran/generated/count_4_l4.c6
-rw-r--r--libgfortran/generated/count_4_l8.c6
-rw-r--r--libgfortran/generated/count_8_l4.c6
-rw-r--r--libgfortran/generated/count_8_l8.c6
-rw-r--r--libgfortran/generated/cshift1_4.c17
-rw-r--r--libgfortran/generated/cshift1_8.c17
-rw-r--r--libgfortran/generated/dotprod_c4.c4
-rw-r--r--libgfortran/generated/dotprod_c8.c4
-rw-r--r--libgfortran/generated/dotprod_i4.c4
-rw-r--r--libgfortran/generated/dotprod_i8.c4
-rw-r--r--libgfortran/generated/dotprod_l4.c4
-rw-r--r--libgfortran/generated/dotprod_l8.c4
-rw-r--r--libgfortran/generated/dotprod_r4.c4
-rw-r--r--libgfortran/generated/dotprod_r8.c4
-rw-r--r--libgfortran/generated/eoshift1_4.c13
-rw-r--r--libgfortran/generated/eoshift1_8.c13
-rw-r--r--libgfortran/generated/eoshift3_4.c11
-rw-r--r--libgfortran/generated/eoshift3_8.c11
-rw-r--r--libgfortran/generated/exponent_r4.c5
-rw-r--r--libgfortran/generated/exponent_r8.c5
-rw-r--r--libgfortran/generated/fraction_r4.c5
-rw-r--r--libgfortran/generated/fraction_r8.c5
-rw-r--r--libgfortran/generated/matmul_c4.c3
-rw-r--r--libgfortran/generated/matmul_c8.c3
-rw-r--r--libgfortran/generated/matmul_i4.c3
-rw-r--r--libgfortran/generated/matmul_i8.c3
-rw-r--r--libgfortran/generated/matmul_l4.c4
-rw-r--r--libgfortran/generated/matmul_l8.c4
-rw-r--r--libgfortran/generated/matmul_r4.c3
-rw-r--r--libgfortran/generated/matmul_r8.c3
-rw-r--r--libgfortran/generated/maxloc0_4_i4.c8
-rw-r--r--libgfortran/generated/maxloc0_4_i8.c8
-rw-r--r--libgfortran/generated/maxloc0_4_r4.c8
-rw-r--r--libgfortran/generated/maxloc0_4_r8.c8
-rw-r--r--libgfortran/generated/maxloc0_8_i4.c8
-rw-r--r--libgfortran/generated/maxloc0_8_i8.c8
-rw-r--r--libgfortran/generated/maxloc0_8_r4.c8
-rw-r--r--libgfortran/generated/maxloc0_8_r8.c8
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c11
-rw-r--r--libgfortran/generated/maxloc1_4_i8.c11
-rw-r--r--libgfortran/generated/maxloc1_4_r4.c11
-rw-r--r--libgfortran/generated/maxloc1_4_r8.c11
-rw-r--r--libgfortran/generated/maxloc1_8_i4.c11
-rw-r--r--libgfortran/generated/maxloc1_8_i8.c11
-rw-r--r--libgfortran/generated/maxloc1_8_r4.c11
-rw-r--r--libgfortran/generated/maxloc1_8_r8.c11
-rw-r--r--libgfortran/generated/maxval_i4.c11
-rw-r--r--libgfortran/generated/maxval_i8.c11
-rw-r--r--libgfortran/generated/maxval_r4.c11
-rw-r--r--libgfortran/generated/maxval_r8.c11
-rw-r--r--libgfortran/generated/minloc0_4_i4.c8
-rw-r--r--libgfortran/generated/minloc0_4_i8.c8
-rw-r--r--libgfortran/generated/minloc0_4_r4.c8
-rw-r--r--libgfortran/generated/minloc0_4_r8.c8
-rw-r--r--libgfortran/generated/minloc0_8_i4.c8
-rw-r--r--libgfortran/generated/minloc0_8_i8.c8
-rw-r--r--libgfortran/generated/minloc0_8_r4.c8
-rw-r--r--libgfortran/generated/minloc0_8_r8.c8
-rw-r--r--libgfortran/generated/minloc1_4_i4.c11
-rw-r--r--libgfortran/generated/minloc1_4_i8.c11
-rw-r--r--libgfortran/generated/minloc1_4_r4.c11
-rw-r--r--libgfortran/generated/minloc1_4_r8.c11
-rw-r--r--libgfortran/generated/minloc1_8_i4.c11
-rw-r--r--libgfortran/generated/minloc1_8_i8.c11
-rw-r--r--libgfortran/generated/minloc1_8_r4.c11
-rw-r--r--libgfortran/generated/minloc1_8_r8.c11
-rw-r--r--libgfortran/generated/minval_i4.c11
-rw-r--r--libgfortran/generated/minval_i8.c11
-rw-r--r--libgfortran/generated/minval_r4.c11
-rw-r--r--libgfortran/generated/minval_r8.c11
-rw-r--r--libgfortran/generated/nearest_r4.c5
-rw-r--r--libgfortran/generated/nearest_r8.c5
-rw-r--r--libgfortran/generated/pow_c4_i4.c7
-rw-r--r--libgfortran/generated/pow_c4_i8.c7
-rw-r--r--libgfortran/generated/pow_c8_i4.c7
-rw-r--r--libgfortran/generated/pow_c8_i8.c7
-rw-r--r--libgfortran/generated/pow_i4_i4.c7
-rw-r--r--libgfortran/generated/pow_i4_i8.c7
-rw-r--r--libgfortran/generated/pow_i8_i4.c7
-rw-r--r--libgfortran/generated/pow_i8_i8.c7
-rw-r--r--libgfortran/generated/pow_r4_i4.c7
-rw-r--r--libgfortran/generated/pow_r4_i8.c7
-rw-r--r--libgfortran/generated/pow_r8_i4.c7
-rw-r--r--libgfortran/generated/pow_r8_i8.c7
-rw-r--r--libgfortran/generated/product_c4.c11
-rw-r--r--libgfortran/generated/product_c8.c11
-rw-r--r--libgfortran/generated/product_i4.c11
-rw-r--r--libgfortran/generated/product_i8.c11
-rw-r--r--libgfortran/generated/product_r4.c11
-rw-r--r--libgfortran/generated/product_r8.c11
-rw-r--r--libgfortran/generated/reshape_i4.c6
-rw-r--r--libgfortran/generated/reshape_i8.c6
-rw-r--r--libgfortran/generated/set_exponent_r4.c5
-rw-r--r--libgfortran/generated/set_exponent_r8.c5
-rw-r--r--libgfortran/generated/shape_i4.c4
-rw-r--r--libgfortran/generated/shape_i8.c4
-rw-r--r--libgfortran/generated/sum_c4.c11
-rw-r--r--libgfortran/generated/sum_c8.c11
-rw-r--r--libgfortran/generated/sum_i4.c11
-rw-r--r--libgfortran/generated/sum_i8.c11
-rw-r--r--libgfortran/generated/sum_r4.c11
-rw-r--r--libgfortran/generated/sum_r8.c11
-rw-r--r--libgfortran/generated/transpose_i4.c3
-rw-r--r--libgfortran/generated/transpose_i8.c3
-rw-r--r--libgfortran/intrinsics/abort.c7
-rw-r--r--libgfortran/intrinsics/args.c73
-rw-r--r--libgfortran/intrinsics/associated.c5
-rw-r--r--libgfortran/intrinsics/cpu_time.c42
-rw-r--r--libgfortran/intrinsics/cshift0.c7
-rw-r--r--libgfortran/intrinsics/date_and_time.c4
-rw-r--r--libgfortran/intrinsics/env.c52
-rw-r--r--libgfortran/intrinsics/eoshift0.c8
-rw-r--r--libgfortran/intrinsics/eoshift2.c8
-rw-r--r--libgfortran/intrinsics/etime.c18
-rw-r--r--libgfortran/intrinsics/exit.c18
-rw-r--r--libgfortran/intrinsics/flush.c5
-rw-r--r--libgfortran/intrinsics/fnum.c9
-rw-r--r--libgfortran/intrinsics/getXid.c24
-rw-r--r--libgfortran/intrinsics/getcwd.c23
-rw-r--r--libgfortran/intrinsics/ishftc.c9
-rw-r--r--libgfortran/intrinsics/mvbits.c8
-rw-r--r--libgfortran/intrinsics/pack_generic.c8
-rw-r--r--libgfortran/intrinsics/rand.c34
-rw-r--r--libgfortran/intrinsics/random.c57
-rw-r--r--libgfortran/intrinsics/reshape_generic.c3
-rw-r--r--libgfortran/intrinsics/size.c11
-rw-r--r--libgfortran/intrinsics/spread_generic.c4
-rw-r--r--libgfortran/intrinsics/stat.c75
-rw-r--r--libgfortran/intrinsics/string_intrinsics.c51
-rw-r--r--libgfortran/intrinsics/system.c16
-rw-r--r--libgfortran/intrinsics/system_clock.c16
-rw-r--r--libgfortran/intrinsics/transpose_generic.c3
-rw-r--r--libgfortran/intrinsics/umask.c34
-rw-r--r--libgfortran/intrinsics/unlink.c24
-rw-r--r--libgfortran/intrinsics/unpack_generic.c8
-rw-r--r--libgfortran/io/backspace.c3
-rw-r--r--libgfortran/io/close.c3
-rw-r--r--libgfortran/io/endfile.c3
-rw-r--r--libgfortran/io/inquire.c3
-rw-r--r--libgfortran/io/io.h352
-rw-r--r--libgfortran/io/lock.c19
-rw-r--r--libgfortran/io/open.c3
-rw-r--r--libgfortran/io/rewind.c4
-rw-r--r--libgfortran/io/transfer.c49
-rw-r--r--libgfortran/libgfortran.h302
-rw-r--r--libgfortran/m4/cshift1.m417
-rw-r--r--libgfortran/m4/dotprod.m46
-rw-r--r--libgfortran/m4/dotprodc.m46
-rw-r--r--libgfortran/m4/dotprodl.m46
-rw-r--r--libgfortran/m4/eoshift1.m413
-rw-r--r--libgfortran/m4/eoshift3.m411
-rw-r--r--libgfortran/m4/exponent.m45
-rw-r--r--libgfortran/m4/fraction.m45
-rw-r--r--libgfortran/m4/iforeach.m412
-rw-r--r--libgfortran/m4/ifunction.m415
-rw-r--r--libgfortran/m4/matmul.m43
-rw-r--r--libgfortran/m4/matmull.m44
-rw-r--r--libgfortran/m4/nearest.m45
-rw-r--r--libgfortran/m4/pow.m47
-rw-r--r--libgfortran/m4/reshape.m46
-rw-r--r--libgfortran/m4/set_exponent.m45
-rw-r--r--libgfortran/m4/shape.m44
-rw-r--r--libgfortran/m4/transpose.m43
-rw-r--r--libgfortran/runtime/environ.c2
-rw-r--r--libgfortran/runtime/error.c8
-rw-r--r--libgfortran/runtime/in_pack_generic.c3
-rw-r--r--libgfortran/runtime/in_unpack_generic.c3
-rw-r--r--libgfortran/runtime/main.c7
-rw-r--r--libgfortran/runtime/memory.c45
-rw-r--r--libgfortran/runtime/pause.c9
-rw-r--r--libgfortran/runtime/select.c11
-rw-r--r--libgfortran/runtime/stop.c6
181 files changed, 2040 insertions, 756 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 971b59d6169..83084aad13a 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 87dc72283f9..2dc8f85e16b 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 a705e84be28..b858c4ef01b 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 485391dcab2..0a5c3f1344a 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 6fd3f508069..ab550971988 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 5a517c1c330..3c81520ae49 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 a58396381a5..c7a8df01b5d 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 93beea72696..da3f2b7295d 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 bc0ede896a7..8258db932b9 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 9c33c2e6d0d..0e3e2981647 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 288aa3ad706..7e9a376960c 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 bf83d3e3c18..c23895b6601 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 ef05c6db7b8..1535af40561 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 9375074db2a..9293eaeb209 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 7303d560440..803984f045b 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 9812ab4e3c8..ff60a23601c 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 fde18021400..cf22c377cf6 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 374d9251300..c0d67264c41 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 6702a1d489c..57224318f67 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 292c0386cd1..6248c9c5b2f 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 4316607a3e5..708628883ad 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 1edfea36e6e..801e43e808d 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 bf35710272b..edde2b2a69b 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 05b1af682e0..aaccb54c007 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 f74c022f178..3f37eb8f187 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 07c2d9e965e..7609b2e127d 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 fcb161df39a..3274bcec7ad 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 34e76b65edb..70c376c952b 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 8a4101efd66..9d5492017a4 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 a86e8292c71..273239a96d4 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 613c6ac702c..b7600bfd604 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 19e4f239cca..a05a3219fba 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 fb422cba5f4..42833b9f6c1 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 e5f534a169d..de8a9199d71 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 88bbf7a3388..b4831e22bd9 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 1af2eb0c6f8..491392b7d95 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 d6d85a1e288..2a479e7bbd4 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 91417ccd1cd..b12a8a48719 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 2fc3fed4be3..b0c45c0726a 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 b55da1f614f..aa7d42841f6 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 36c0ef59705..100910eec09 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 40f58cc3340..0b75c05aa3f 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 ebb60201586..1463d8062ce 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 335a3290604..822ddd06d34 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 5bee14af5d3..8a4ed813fb8 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 7839e51249c..73a3e2d75b1 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 088d89c177e..cc3e8d5dc2e 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 2369e77cc8b..7905c017934 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 36860c2ea0c..a08cb037b53 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 6d550d55149..5c5c3af2cc0 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 07a9ecad815..665c5b5dcaf 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 79142592cfb..dc11e701bb5 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 46a7561089a..68dd21f0491 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 1ab1be85a95..adeac9a35a5 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 b221baae4c3..82e754c36e4 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 8d37dfee18a..f24735c796b 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 bdb33c9ce65..e9ef4ecb330 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 78e83dcbe78..7339490bc5a 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 e3c74539aed..cbc1fc9ca61 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 c12eea0261d..c377498aeb8 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 94842a3704e..56fd2618109 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 9ed52c32718..30b5b1ddde1 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 186b49382b6..8a4267d653a 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 962ee836255..6d7cb9c4d63 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 e13a4280d0b..87d6705ae4a 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 cb9ade8db18..660a7634779 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 cf19f44fbb2..b8c83035ab5 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 ce739168dfc..eaf4212cd26 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 55a249beacb..0ea3802a5ab 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 50adeb33cba..3336f0fbfb4 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 aafb578cc2e..bb59dccd77d 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 5c347dd12b5..c30f656a1ad 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 c8811f36ffa..4d3e34ad1a9 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 81ba1672116..e5c1a59bf10 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 684eab26565..ff7ebb913f2 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 784645297d9..23b83262157 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 deca048917a..149ba7a1871 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 8990d88b3f2..3a4b13df178 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 285e90e016d..e30c4314580 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 cafc02f21f2..d92efab2a62 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 54a374546df..7dd6838f89e 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 de0f6f62dfe..8aa3bf57ebb 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 6606527b4ad..007c2774c8a 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 5efb874d7e4..d8bc9fa44e2 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 17026b32c14..f0e8b3887f4 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 15a349c1e9c..9b2d15301d8 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 72e8837912c..a721a6b03d0 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 7a900d74dae..5e0d4527efb 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 591536fce7b..2269051d882 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 ffb8df7a8b2..51524fef90d 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 128388258a6..2e0a71b591e 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 fcead044cf2..d07b57135dd 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 7f75c82f79b..e922eef8b45 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 0337ec61c0e..f8fcdcb2da1 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 22a26a8e739..4e54c68fcf0 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 c50c07f068b..386fbf9b02e 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 0f09a411b51..0e5ac66ca2d 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 f68a88ab835..cf38879d3f2 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 0936d181232..adba0bc286b 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 7da866cf5d0..70c32358b34 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 f4e40197d82..af76e254d7d 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 32717e22305..9763ef6916d 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 ad2a97d837b..91b0e71fd6c 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 03446912f61..855ccc06b87 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 bd7490016ae..0dc92f03c35 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 6507de88797..a4af04ada23 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 bc2d045e667..f421e80166e 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 aac7f482e92..55b000d83fc 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 e9a539d992d..d72bd128708 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 11b5c494483..dcb81554e0c 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 95272fb1f16..3a6ea96f2d5 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 dad2987fca7..24ae8a8878c 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 84811d0d012..67ef0ddffaa 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 cc2a422cd3f..8ab86ba4af5 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 984fa91d352..f6742812623 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 e7805f1ee13..012ffc11b37 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 887debc3e53..58f22534b94 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 6d7a8018867..9fd87855634 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 e0b01234556..67679f897a2 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 ab596fce59c..d116f1ccaa7 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 db9dd657200..df749a4072c 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 a20da552585..388486d203c 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 d8c2f115622..9a8f976a55d 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 f15d56787bf..fcb792e10b0 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 5f75195b9e4..3e709094e52 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 251cfb4e937..f5594648568 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 01aec12fed0..4690d149cf8 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 86afa6ca5c4..318a3a951a5 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 2677c3313f9..7d5767c9144 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 97fdc41177c..140547bf482 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 75a8661ba8f..0332b7957a8 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 f4e78d0470e..7989020fbc4 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 2cc5d20372d..0ea60eccac7 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 5314456ca26..aecc6b6469d 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 f83f6c0162e..b001f3430df 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 f65f869d3b0..0cada54c99f 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 8f250d460f0..de4a14736fa 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 faacaab56f8..f5b5bc141fb 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 d962601d165..308717e6fe2 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 d11d1a99d35..b778b0373a3 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 55d2729aea9..ba3014f07aa 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 cf41451e31a..2e8e165a6a3 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 7ea2a1002a3..b9187068786 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 a301b58d46b..16deea4d48d 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 eb25b108146..9cdddb68208 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 48d669b2ce7..827eea86521 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 d8462a3faed..76a1c34a04d 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 a93f99dc170..290f31c832e 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 e30944863c7..e4f8f889bc0 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 8daf1aa57c3..f0f8ddf4c0f 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 28a6babcd8a..6991c38a703 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 b6363dcca2a..bfc2bc4bc4b 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 ec5240ddf49..9822a76e950 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 3732707dca8..c259e565566 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 46ae7ce1335..989f91cfdb6 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 bde4c20512c..3e3245c0aac 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 eb97efa3121..38ef7fc0849 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 8f886d3bd60..dc196e0bb1b 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 a7852e0e40a..f8ae460b78c 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 a5407520b0b..4e706dc8aa3 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 510f763292d..a0e31e3c84b 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 c453e78ac41..dd71865d4d3 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 4106ddc7aaf..b67770b4843 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 93b31973e1c..0a377a58e9f 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 9af77ceea50..ef631d3e5f8 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 0d66a42a4e2..4091ef65f2e 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 5168d99c8e2..54b8550e9b1 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 4bf453a3946..724cebe5d5d 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 7400f31ad76..7355a7a172b 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 352a129865e..00ea8b0d941 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 6c58658738b..e10fe0c0986 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 55f4b572917..e519b2965ad 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 dc6e590a10b..02831f14a0e 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 913812c9f51..2ccaff06768 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 fefac079dbd..7849a58012f 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 d468e741ea7..313a79f5fa2 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 4e1f78c93c7..882946c41a0 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 22808483619..71bad9f3bd9 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 e2d08bea6b3..e6d683b70fb 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 5ee873aefcb..807845cee58 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 ef8741aa748..5ae06ec957b 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)