aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/m4
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-12 00:59:05 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-12 00:59:05 -0800
commit7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35 (patch)
treecb0ecd2cd7b8c21d4d1c38261b5b7116e8dd2782 /libgfortran/m4
parentc431e4997fcca052667b780341ddf4df5f6eb55c (diff)
downloadgcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.zip
gcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.tar.gz
gcc-7d7b8bfe55f8598f2fa0f842fb7f95060c45fa35.tar.bz2
acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New. (LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New. (LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New. * configure.ac: Use them. * configure, config.h.in, aclocal.m4: Rebuild. * libgfortran.h (prefix): Remove. (PREFIX, IPREFIX): New. (sym_rename, sym_rename1, sym_rename2): New. (internal_proto, export_proto, export_proto_np): New. (iexport_proto, iexport): New. (iexport_data_proto, iexport_data): New. * intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c, intrinsics/cpu_time.c, intrinsics/cshift0.c, intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c, intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c, intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c, intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c, intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c, intrinsics/reshape_generic.c, intrinsics/size.c, intrinsics/spread_generic.c, intrinsics/stat.c, intrinsics/string_intrinsics.c, intrinsics/system.c, intrinsics/system_clock.c, intrinsics/transpose_generic.c, intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c, io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h, io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4, m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4, m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4, m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4, m4/transpose.m4, runtime/environ.c, runtime/error.c, runtime/in_pack_generic.c, runtime/in_unpack_generic.c, runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c, runtime/stop.c: Use them to mark symbols internal or external. * generated/*: Rebuild. From-SVN: r92045
Diffstat (limited to 'libgfortran/m4')
-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
18 files changed, 102 insertions, 31 deletions
diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4
index 46ae7ce..989f91c 100644
--- a/libgfortran/m4/cshift1.m4
+++ b/libgfortran/m4/cshift1.m4
@@ -26,9 +26,15 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"'
include(iparm.m4)dnl
+void __cshift1_`'atype_kind (const gfc_array_char * ret,
+ const gfc_array_char * array,
+ const atype * h, const atype_name * pwhich);
+export_proto_np(__cshift1_`'atype_kind);
+
void
-`__cshift1_'atype_kind (const gfc_array_char * ret, const gfc_array_char * array,
- const atype * h, const atype_name * pwhich)
+__cshift1_`'atype_kind (const gfc_array_char * ret,
+ const gfc_array_char * array,
+ const atype * h, const atype_name * pwhich)
{
/* r.* indicates the return array. */
index_type rstride[GFC_MAX_DIMENSIONS - 1];
@@ -42,7 +48,7 @@ void
index_type soffset;
const char *sptr;
const char *src;
-` /* h.* indicates the shift array. */'
+ /* h.* indicates the shift array. */
index_type hstride[GFC_MAX_DIMENSIONS - 1];
index_type hstride0;
const atype_name *hptr;
@@ -71,7 +77,7 @@ void
size = GFC_DESCRIPTOR_SIZE (array);
n = 0;
-`/* Initialized for avoiding compiler warnings. */'
+ /* Initialized for avoiding compiler warnings. */
roffset = size;
soffset = size;
len = 0;
@@ -116,7 +122,7 @@ void
while (rptr)
{
-` /* Do the shift for this dimension. */'
+ /* Do the shift for this dimension. */
sh = *hptr;
sh = (div (sh, len)).rem;
if (sh < 0)
@@ -168,4 +174,3 @@ void
}
}
}
-
diff --git a/libgfortran/m4/dotprod.m4 b/libgfortran/m4/dotprod.m4
index bde4c20..3e3245c 100644
--- a/libgfortran/m4/dotprod.m4
+++ b/libgfortran/m4/dotprod.m4
@@ -27,9 +27,12 @@ include(iparm.m4)dnl
typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array;
+extern rtype_name __dot_product_`'rtype_code (rtype * a, rtype * b);
+export_proto_np(__dot_product_`'rtype_code);
+
/* Both parameters will already have been converted to the result type. */
rtype_name
-`__dot_product_'rtype_code (rtype * a, rtype * b)
+__dot_product_`'rtype_code (rtype * a, rtype * b)
{
rtype_name *pa;
rtype_name *pb;
@@ -63,4 +66,3 @@ sinclude(`dotprod_asm_'rtype_code`.m4')dnl
return res;
}
-
diff --git a/libgfortran/m4/dotprodc.m4 b/libgfortran/m4/dotprodc.m4
index eb97efa..38ef7fc 100644
--- a/libgfortran/m4/dotprodc.m4
+++ b/libgfortran/m4/dotprodc.m4
@@ -28,9 +28,12 @@ include(iparm.m4)dnl
typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array;
+extern rtype_name __dot_product_`'rtype_code (rtype * a, rtype * b);
+export_proto_np(__dot_product_`'rtype_code);
+
/* Both parameters will already have been converted to the result type. */
rtype_name
-`__dot_product_'rtype_code (rtype * a, rtype * b)
+__dot_product_`'rtype_code (rtype * a, rtype * b)
{
rtype_name *pa;
rtype_name *pb;
@@ -66,4 +69,3 @@ sinclude(`dotprod_asm_'rtype_code`.m4')dnl
return res;
}
-
diff --git a/libgfortran/m4/dotprodl.m4 b/libgfortran/m4/dotprodl.m4
index 8f886d3..dc196e0 100644
--- a/libgfortran/m4/dotprodl.m4
+++ b/libgfortran/m4/dotprodl.m4
@@ -25,8 +25,11 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"'
include(iparm.m4)dnl
+extern rtype_name __dot_product_`'rtype_code (gfc_array_l4 *, gfc_array_l4 *);
+export_proto_np(__dot_product_`'rtype_code);
+
rtype_name
-`__dot_product_'rtype_code (gfc_array_l4 * a, gfc_array_l4 * b)
+__dot_product_`'rtype_code (gfc_array_l4 * a, gfc_array_l4 * b)
{
GFC_LOGICAL_4 *pa;
GFC_LOGICAL_4 *pb;
@@ -72,4 +75,3 @@ rtype_name
return 0;
}
-
diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4
index a7852e0..f8ae460 100644
--- a/libgfortran/m4/eoshift1.m4
+++ b/libgfortran/m4/eoshift1.m4
@@ -29,9 +29,17 @@ include(iparm.m4)dnl
static const char zeros[16] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+extern void __eoshift1_`'atype_kind (const gfc_array_char *,
+ const gfc_array_char *,
+ const atype *, const char *,
+ const atype_name *);
+export_proto_np(__eoshift1_`'atype_kind);
+
void
-`__eoshift1_'atype_kind (const gfc_array_char * ret, const gfc_array_char * array,
- const atype * h, const char * pbound, const atype_name * pwhich)
+__eoshift1_`'atype_kind (const gfc_array_char *ret,
+ const gfc_array_char *array,
+ const atype *h, const char *pbound,
+ const atype_name *pwhich)
{
/* r.* indicates the return array. */
index_type rstride[GFC_MAX_DIMENSIONS - 1];
@@ -176,4 +184,3 @@ void
}
}
}
-
diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4
index a540752..4e706dc 100644
--- a/libgfortran/m4/eoshift3.m4
+++ b/libgfortran/m4/eoshift3.m4
@@ -29,9 +29,15 @@ include(iparm.m4)dnl
static const char zeros[16] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+extern void __eoshift3_`'atype_kind (gfc_array_char *, gfc_array_char *,
+ atype *, const gfc_array_char *,
+ atype_name *);
+export_proto_np(__eoshift3_`'atype_kind);
+
void
-`__eoshift3_'atype_kind (gfc_array_char * ret, gfc_array_char * array,
- atype * h, const gfc_array_char * bound, atype_name * pwhich)
+__eoshift3_`'atype_kind (gfc_array_char *ret, gfc_array_char *array,
+ atype *h, const gfc_array_char *bound,
+ atype_name *pwhich)
{
/* r.* indicates the return array. */
index_type rstride[GFC_MAX_DIMENSIONS - 1];
@@ -191,4 +197,3 @@ void
}
}
}
-
diff --git a/libgfortran/m4/exponent.m4 b/libgfortran/m4/exponent.m4
index 510f763..a0e31e3 100644
--- a/libgfortran/m4/exponent.m4
+++ b/libgfortran/m4/exponent.m4
@@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */
include(`mtype.m4')dnl
+extern GFC_INTEGER_4 exponent_r`'kind (real_type s);
+export_proto(exponent_r`'kind);
+
GFC_INTEGER_4
-prefix(exponent_r`'kind) (real_type s)
+exponent_r`'kind (real_type s)
{
int ret;
frexp`'q (s, &ret);
diff --git a/libgfortran/m4/fraction.m4 b/libgfortran/m4/fraction.m4
index c453e78..dd71865 100644
--- a/libgfortran/m4/fraction.m4
+++ b/libgfortran/m4/fraction.m4
@@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */
include(`mtype.m4')dnl
+extern real_type fraction_r`'kind (real_type s);
+export_proto(fraction_r`'kind);
+
real_type
-prefix(fraction_r`'kind) (real_type s)
+fraction_r`'kind (real_type s)
{
int dummy_exp;
return frexp`'q (s, &dummy_exp);
diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4
index 4106ddc..b67770b 100644
--- a/libgfortran/m4/iforeach.m4
+++ b/libgfortran/m4/iforeach.m4
@@ -3,7 +3,11 @@ dnl Contains the generic sections of the array functions.
dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran)
dnl Distributed under the GNU LGPL. See COPYING for details.
define(START_FOREACH_FUNCTION,
-`void
+`
+extern void `__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array);
+export_proto_np(`__'name`'rtype_qual`_'atype_code);
+
+void
`__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array)
{
index_type count[GFC_MAX_DIMENSIONS];
@@ -85,7 +89,11 @@ define(FINISH_FOREACH_FUNCTION,
}
}')dnl
define(START_MASKED_FOREACH_FUNCTION,
-`void
+`
+extern void `__m'name`'rtype_qual`_'atype_code (rtype *, atype *, gfc_array_l4 *);
+export_proto_np(`__m'name`'rtype_qual`_'atype_code);
+
+void
`__m'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array, gfc_array_l4 * mask)
{
index_type count[GFC_MAX_DIMENSIONS];
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index 93b3197..0a377a5 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -18,8 +18,12 @@ dnl Execution should be allowed to continue to the end of the block.
dnl You should not return or break from the inner loop of the implementation.
dnl Care should also be taken to avoid using the names defined in iparm.m4
define(START_ARRAY_FUNCTION,
-`void
-`__'name`'rtype_qual`_'atype_code (rtype * retarray, atype *array, index_type *pdim)
+`
+extern void `__'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *);
+export_proto_np(`__'name`'rtype_qual`_'atype_code);
+
+void
+`__'name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim)
{
index_type count[GFC_MAX_DIMENSIONS - 1];
index_type extent[GFC_MAX_DIMENSIONS - 1];
@@ -138,7 +142,12 @@ define(FINISH_ARRAY_FUNCTION,
}
}')dnl
define(START_MASKED_ARRAY_FUNCTION,
-`void
+`
+extern void `__m'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *,
+ gfc_array_l4 *);
+export_proto_np(`__m'name`'rtype_qual`_'atype_code);
+
+void
`__m'name`'rtype_qual`_'atype_code (rtype * retarray, atype * array, index_type *pdim, gfc_array_l4 * mask)
{
index_type count[GFC_MAX_DIMENSIONS - 1];
diff --git a/libgfortran/m4/matmul.m4 b/libgfortran/m4/matmul.m4
index 9af77ce..ef631d3 100644
--- a/libgfortran/m4/matmul.m4
+++ b/libgfortran/m4/matmul.m4
@@ -38,6 +38,9 @@ include(iparm.m4)dnl
C(I,J) = C(I,J)+A(I,K)*B(K,J)
*/
+extern void `__matmul_'rtype_code (rtype * retarray, rtype * a, rtype * b);
+export_proto_np(`__matmul_'rtype_code);
+
void
`__matmul_'rtype_code (rtype * retarray, rtype * a, rtype * b)
{
diff --git a/libgfortran/m4/matmull.m4 b/libgfortran/m4/matmull.m4
index 0d66a42..4091ef6 100644
--- a/libgfortran/m4/matmull.m4
+++ b/libgfortran/m4/matmull.m4
@@ -27,6 +27,10 @@ include(iparm.m4)dnl
/* Dimensions: retarray(x,y) a(x, count) b(count,y).
Either a or b can be rank 1. In this case x or y is 1. */
+
+extern void `__matmul_'rtype_code (rtype *, gfc_array_l4 *, gfc_array_l4 *);
+export_proto_np(`__matmul_'rtype_code);
+
void
`__matmul_'rtype_code (rtype * retarray, gfc_array_l4 * a, gfc_array_l4 * b)
{
diff --git a/libgfortran/m4/nearest.m4 b/libgfortran/m4/nearest.m4
index 5168d99..54b8550 100644
--- a/libgfortran/m4/nearest.m4
+++ b/libgfortran/m4/nearest.m4
@@ -24,8 +24,11 @@ Boston, MA 02111-1307, USA. */
include(`mtype.m4')dnl
+extern real_type nearest_r`'kind (real_type s, real_type dir);
+export_proto(nearest_r`'kind);
+
real_type
-prefix(nearest_r`'kind) (real_type s, real_type dir)
+nearest_r`'kind (real_type s, real_type dir)
{
dir = copysign`'q (__builtin_inf`'q (), dir);
if (FLT_EVAL_METHOD != 0)
diff --git a/libgfortran/m4/pow.m4 b/libgfortran/m4/pow.m4
index 4bf453a..724cebe 100644
--- a/libgfortran/m4/pow.m4
+++ b/libgfortran/m4/pow.m4
@@ -23,13 +23,16 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"'
include(iparm.m4)dnl
-/* Uuse Binary Method to calculate the powi. This is not an optimal but
+/* Use Binary Method to calculate the powi. This is not an optimal but
a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
of Computer Programming", 3rd Edition, 1998. */
+rtype_name `pow_'rtype_code`_'atype_code (rtype_name a, atype_name b);
+export_proto(pow_`'rtype_code`_'atype_code);
+
rtype_name
-`prefix(pow_'rtype_code`_'atype_code) (rtype_name a, atype_name b)
+`pow_'rtype_code`_'atype_code (rtype_name a, atype_name b)
{
rtype_name pow, x;
atype_name n, u;
diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4
index 7400f31..7355a7a 100644
--- a/libgfortran/m4/reshape.m4
+++ b/libgfortran/m4/reshape.m4
@@ -30,6 +30,11 @@ typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
/* The shape parameter is ignored. We can currently deduce the shape from the
return array. */
dnl Only the kind (ie size) is used to name the function.
+
+extern void `__reshape_'rtype_kind (rtype *, rtype *, shape_type *,
+ rtype *, shape_type *);
+extern_proto_np(`__reshape_'rtype_kind);
+
void
`__reshape_'rtype_kind (rtype * ret, rtype * source, shape_type * shape,
rtype * pad, shape_type * order)
@@ -224,4 +229,3 @@ void
}
}
}
-
diff --git a/libgfortran/m4/set_exponent.m4 b/libgfortran/m4/set_exponent.m4
index 352a129..00ea8b0 100644
--- a/libgfortran/m4/set_exponent.m4
+++ b/libgfortran/m4/set_exponent.m4
@@ -23,8 +23,11 @@ Boston, MA 02111-1307, USA. */
include(`mtype.m4')dnl
+extern real_type set_exponent_r`'kind (real_type s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r`'kind);
+
real_type
-prefix(set_exponent_r`'kind) (real_type s, GFC_INTEGER_4 i)
+set_exponent_r`'kind (real_type s, GFC_INTEGER_4 i)
{
int dummy_exp;
return scalbn`'q (frexp`'q (s, &dummy_exp), i);
diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4
index 6c58658..e10fe0c 100644
--- a/libgfortran/m4/shape.m4
+++ b/libgfortran/m4/shape.m4
@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"'
include(iparm.m4)dnl
+extern void `__shape_'rtype_kind (rtype * ret, const rtype * array);
+export_proto_np(`__shape_'rtype_kind);
+
void
`__shape_'rtype_kind (rtype * ret, const rtype * array)
{
@@ -41,4 +44,3 @@ void
array->dim[n].ubound + 1 - array->dim[n].lbound;
}
}
-
diff --git a/libgfortran/m4/transpose.m4 b/libgfortran/m4/transpose.m4
index 55f4b57..e519b29 100644
--- a/libgfortran/m4/transpose.m4
+++ b/libgfortran/m4/transpose.m4
@@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"'
include(iparm.m4)dnl
+extern void `__transpose_'rtype_kind (rtype * ret, rtype * source);
+export_proto_np(`__transpose_'rtype_kind);
+
void
`__transpose_'rtype_kind (rtype * ret, rtype * source)
{