summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-06 23:02:38 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-06 23:02:38 +0000
commit40555542b7fab2e5b54b7356f51ae1a322127712 (patch)
tree22a8fdfdc53e25a6f6189de25babaa2d78f182d8 /libgfortran
parent3ccfa1cbd448bfd037bfd102bf0d7ccebbc30cee (diff)
downloadgcc-40555542b7fab2e5b54b7356f51ae1a322127712.tar.gz
PR fortran/30947
* iresolve.c (gfc_resolve_alarm_sub): Suffix the subroutine name with the kind of the STATUS argument. * intrinsics/signal.c: Create specific versions of alarm_sub and alarm_sub_int according to the integer kind of the last argument. * gfortran.map (GFORTRAN_1.0): Remove _gfortran_alarm_sub and _gfortran_alarm_sub_int, add _gfortran_alarm_sub_i4, _gfortran_alarm_sub_i8, _gfortran_alarm_sub_int_i4 and _gfortran_alarm_sub_int_i8. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127259 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog10
-rw-r--r--libgfortran/gfortran.map6
-rw-r--r--libgfortran/intrinsics/signal.c72
3 files changed, 78 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e205466bb46..c7e57db9a91 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,15 @@
2007-08-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ PR fortran/30947
+ * intrinsics/signal.c: Create specific versions of alarm_sub and
+ alarm_sub_int according to the integer kind of the last argument.
+ * gfortran.map (GFORTRAN_1.0): Remove _gfortran_alarm_sub and
+ _gfortran_alarm_sub_int, add _gfortran_alarm_sub_i4,
+ _gfortran_alarm_sub_i8, _gfortran_alarm_sub_int_i4 and
+ _gfortran_alarm_sub_int_i8.
+
+2007-08-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
PR fortran/29828
* intrinsics/string_intrinsics.c (string_minmax): New function
and prototype.
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index ed881ebfbcc..8cfc23670b7 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -4,8 +4,10 @@ GFORTRAN_1.0 {
_gfortran_access_func;
_gfortran_adjustl;
_gfortran_adjustr;
- _gfortran_alarm_sub;
- _gfortran_alarm_sub_int;
+ _gfortran_alarm_sub_i4;
+ _gfortran_alarm_sub_i8;
+ _gfortran_alarm_sub_int_i4;
+ _gfortran_alarm_sub_int_i8;
_gfortran_all_l16;
_gfortran_all_l4;
_gfortran_all_l8;
diff --git a/libgfortran/intrinsics/signal.c b/libgfortran/intrinsics/signal.c
index 2c2f38d2969..c69efac1f18 100644
--- a/libgfortran/intrinsics/signal.c
+++ b/libgfortran/intrinsics/signal.c
@@ -132,11 +132,11 @@ iexport(signal_func_int);
/* ALARM intrinsic with PROCEDURE as handler */
-extern void alarm_sub (int *, void (*)(int), int *);
-iexport_proto(alarm_sub);
+extern void alarm_sub_i4 (int *, void (*)(int), GFC_INTEGER_4 *);
+iexport_proto(alarm_sub_i4);
void
-alarm_sub (int *seconds, void (*handler)(int), int *status)
+alarm_sub_i4 (int *seconds, void (*handler)(int), GFC_INTEGER_4 *status)
{
#if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
if (status != NULL)
@@ -157,15 +157,71 @@ alarm_sub (int *seconds, void (*handler)(int), int *status)
*status = -1;
#endif
}
-iexport(alarm_sub);
+iexport(alarm_sub_i4);
+
+
+extern void alarm_sub_i8 (int *, void (*)(int), GFC_INTEGER_8 *);
+iexport_proto(alarm_sub_i8);
+
+void
+alarm_sub_i8 (int *seconds, void (*handler)(int), GFC_INTEGER_8 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
+ if (status != NULL)
+ {
+ if (signal (SIGALRM, handler) == SIG_ERR)
+ *status = -1;
+ else
+ *status = alarm (*seconds);
+ }
+ else
+ {
+ signal (SIGALRM, handler);
+ alarm (*seconds);
+ }
+#else
+ errno = ENOSYS;
+ if (status != NULL)
+ *status = -1;
+#endif
+}
+iexport(alarm_sub_i8);
/* ALARM intrinsic with INTEGER as handler */
-extern void alarm_sub_int (int *, int *, int *);
-iexport_proto(alarm_sub_int);
+extern void alarm_sub_int_i4 (int *, int *, GFC_INTEGER_4 *);
+iexport_proto(alarm_sub_int_i4);
+
+void
+alarm_sub_int_i4 (int *seconds, int *handler, GFC_INTEGER_4 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
+ if (status != NULL)
+ {
+ if (signal (SIGALRM, (void (*)(int)) *handler) == SIG_ERR)
+ *status = -1;
+ else
+ *status = alarm (*seconds);
+ }
+ else
+ {
+ signal (SIGALRM, (void (*)(int)) *handler);
+ alarm (*seconds);
+ }
+#else
+ errno = ENOSYS;
+ if (status != NULL)
+ *status = -1;
+#endif
+}
+iexport(alarm_sub_int_i4);
+
+
+extern void alarm_sub_int_i8 (int *, int *, GFC_INTEGER_8 *);
+iexport_proto(alarm_sub_int_i8);
void
-alarm_sub_int (int *seconds, int *handler, int *status)
+alarm_sub_int_i8 (int *seconds, int *handler, GFC_INTEGER_8 *status)
{
#if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
if (status != NULL)
@@ -186,5 +242,5 @@ alarm_sub_int (int *seconds, int *handler, int *status)
*status = -1;
#endif
}
-iexport(alarm_sub_int);
+iexport(alarm_sub_int_i8);