aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2012-06-21 18:47:01 +0000
committerJanne Blomqvist <jb@gcc.gnu.org>2012-06-21 18:47:01 +0000
commit6eaa6360a6e11a8ffe2b2989592238d0905082ff (patch)
tree59aa2323ea68faca7af3c3ce061a65ad40e8ebb7 /libgfortran
parent174cfb786f12563649f161941cc7d3dd35eaf622 (diff)
PR 39654 FTELL intrinsic function return type.
frontend ChangeLog: 2012-06-21 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/39654 * iresolve.c (gfc_resolve_ftell): Fix result kind and use new library function. library ChangeLog: 2012-06-21 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/39654 * io/intrinsics.c (ftell2): New function. * gfortran.map (_gfortran_ftell2): Export function. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@188858 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/gfortran.map5
-rw-r--r--libgfortran/io/intrinsics.c20
3 files changed, 31 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6f204f14769..96a8e8ba42a 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-21 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/39654
+ * io/intrinsics.c (ftell2): New function.
+ * gfortran.map (_gfortran_ftell2): Export function.
+
2012-06-04 Robert Mason <rbmj@verizon.net>
Janne Blomqvist <jb@gcc.gnu.org>
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index 211db00cd10..217d2a3cf51 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -1189,6 +1189,11 @@ GFORTRAN_1.4 {
_gfortran_eoshift2_16_char4;
} GFORTRAN_1.3;
+GFORTRAN_1.5 {
+ global:
+ _gfortran_ftell2;
+} GFORTRAN_1.4;
+
F2C_1.0 {
global:
_gfortran_f2c_specific__abs_c4;
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c
index 576434a8e4c..9abadae4373 100644
--- a/libgfortran/io/intrinsics.c
+++ b/libgfortran/io/intrinsics.c
@@ -272,6 +272,10 @@ gf_ftell (int unit)
return ret;
}
+
+/* Here is the ftell function with an incorrect return type; retained
+ due to ABI compatibility. */
+
extern size_t PREFIX(ftell) (int *);
export_proto_np(PREFIX(ftell));
@@ -281,6 +285,22 @@ PREFIX(ftell) (int * unit)
return gf_ftell (*unit);
}
+
+/* Here is the ftell function with the correct return type, ensuring
+ that large files can be supported as long as the target supports
+ large integers; as of 4.8 the FTELL intrinsic function will call
+ this one instead of the old ftell above. */
+
+extern GFC_IO_INT PREFIX(ftell2) (int *);
+export_proto_np(PREFIX(ftell2));
+
+GFC_IO_INT
+PREFIX(ftell2) (int * unit)
+{
+ return gf_ftell (*unit);
+}
+
+
#define FTELL_SUB(kind) \
extern void ftell_i ## kind ## _sub (int *, GFC_INTEGER_ ## kind *); \
export_proto(ftell_i ## kind ## _sub); \