aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-01-12 17:37:47 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-01-12 17:37:47 +0000
commitedf8dc34ff317170ae61310ef64155723f775fbc (patch)
treee0c22bb94361ac906b41acf62af6059ec502d411
parent4cd5f6193db267e7ac990abcc6a04dbaac800bc8 (diff)
downloadgcc-edf8dc34ff317170ae61310ef64155723f775fbc.zip
gcc-edf8dc34ff317170ae61310ef64155723f775fbc.tar.gz
gcc-edf8dc34ff317170ae61310ef64155723f775fbc.tar.bz2
c99_functions.c: Add function prototypes to avoid warnings from -Wstrict-prototypes...
* intrinsics/c99_functions.c: Add function prototypes to avoid warnings from -Wstrict-prototypes -Wmissing-prototypes. On Tru64 work around a brain-dead libm by redirecting calls to cabs{,f,l} to a local __gfc_cabs{,f,l}. From-SVN: r109646
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/intrinsics/c99_functions.c27
2 files changed, 34 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index ccf5dec..9eaa989 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-12 Roger Sayle <roger@eyesopen.com>
+
+ * intrinsics/c99_functions.c: Add function prototypes to avoid
+ warnings from -Wstrict-prototypes -Wmissing-prototypes. On Tru64
+ work around a brain-dead libm by redirecting calls to cabs{,f,l}
+ to a local __gfc_cabs{,f,l}.
+
2006-01-07 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Remove check for sys/mman.h.
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 5e93e42..feb4c08 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -35,6 +35,33 @@ Boston, MA 02110-1301, USA. */
#define C99_PROTOS_H WE_DONT_WANT_PROTOS_NOW
#include "libgfortran.h"
+/* Tru64's <math.h> declares a non-C99 compliant implementation of cabs,
+ which takes two floating point arguments instead of a single complex.
+ To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}. */
+
+#ifdef __osf__
+#undef HAVE_CABS
+#undef HAVE_CABSF
+#undef HAVE_CABSL
+#define cabs __gfc_cabs
+#define cabsf __gfc_cabsf
+#define cabsl __gfc_cabsl
+#endif
+
+/* Prototypes to silence -Wstrict-prototypes -Wmissing-prototypes. */
+
+float cabsf(float complex);
+double cabs(double complex);
+long double cabsl(long double complex);
+
+float cargf(float complex);
+double carg(double complex);
+long double cargl(long double complex);
+
+float complex clog10f(float complex);
+double complex clog10(double complex);
+long double complex clog10l(long double complex);
+
#ifndef HAVE_ACOSF
#define HAVE_ACOSF 1