about summary refs log tree commit diff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-08 09:10:42 +0000
committerJakub Jelinek <jakub@redhat.com>2005-07-08 09:10:42 +0000
commit48f006fc656c70757103dc9efa92d5775717576b (patch)
tree49d57e1205b93471c3245fceab5dd5ac31ba743d /sysdeps/generic
parent03d65262fdcc287ef8b691c7dff2f1a63cdd13c2 (diff)
downloadglibc-48f006fc656c70757103dc9efa92d5775717576b.tar.gz
glibc-48f006fc656c70757103dc9efa92d5775717576b.tar.xz
glibc-48f006fc656c70757103dc9efa92d5775717576b.zip
Updated to fedora-glibc-20050708T0811
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/libc-start.c14
-rw-r--r--sysdeps/generic/s_ctan.c16
-rw-r--r--sysdeps/generic/s_ctanf.c17
-rw-r--r--sysdeps/generic/s_ctanh.c16
-rw-r--r--sysdeps/generic/s_ctanhf.c16
-rw-r--r--sysdeps/generic/s_ctanhl.c16
-rw-r--r--sysdeps/generic/s_ctanl.c17
7 files changed, 81 insertions, 31 deletions
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index 3fcadcf19f..194db6b1ec 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -75,11 +75,7 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
 #ifdef LIBC_START_MAIN_AUXVEC_ARG
 			    ElfW(auxv_t) *__unbounded auxvec,
 #endif
-#ifdef INIT_MAIN_ARGS
 			    __typeof (main) init,
-#else
-			    void (*init) (void),
-#endif
 			    void (*fini) (void),
 			    void (*rtld_fini) (void),
 			    void *__unbounded stack_end)
@@ -95,11 +91,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 #ifdef LIBC_START_MAIN_AUXVEC_ARG
 		 ElfW(auxv_t) *__unbounded auxvec,
 #endif
-#ifdef INIT_MAIN_ARGS
 		 __typeof (main) init,
-#else
-		 void (*init) (void),
-#endif
 		 void (*fini) (void),
 		 void (*rtld_fini) (void), void *__unbounded stack_end)
 {
@@ -195,11 +187,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
     GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]);
 #endif
   if (init)
-    (*init) (
-#ifdef INIT_MAIN_ARGS
-	     argc, argv, __environ MAIN_AUXVEC_PARAM
-#endif
-	     );
+    (*init) (argc, argv, __environ MAIN_AUXVEC_PARAM);
 
 #ifdef SHARED
   /* Auditing checkpoint: we have a new object.  */
diff --git a/sysdeps/generic/s_ctan.c b/sysdeps/generic/s_ctan.c
index 6a09fe465b..0464ab86d5 100644
--- a/sysdeps/generic/s_ctan.c
+++ b/sysdeps/generic/s_ctan.c
@@ -1,5 +1,5 @@
 /* Complex tangent function for double.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,18 @@ __ctan (__complex__ double x)
 
       den = cos2rx + __ieee754_cosh (2.0 * __imag__ x);
 
-      __real__ res = sin2rx / den;
-      __imag__ res = __ieee754_sinh (2.0 * __imag__ x) / den;
+      if (den == 0.0)
+	{
+	  __complex__ double ez = __cexp (1.0i * x);
+	  __complex__ double emz = __cexp (-1.0i * x);
+
+	  res = (ez - emz) / (ez + emz) * -1.0i;
+	}
+      else
+	{
+	  __real__ res = sin2rx / den;
+	  __imag__ res = __ieee754_sinh (2.0 * __imag__ x) / den;
+	}
     }
 
   return res;
diff --git a/sysdeps/generic/s_ctanf.c b/sysdeps/generic/s_ctanf.c
index e02971dd44..58d9d13298 100644
--- a/sysdeps/generic/s_ctanf.c
+++ b/sysdeps/generic/s_ctanf.c
@@ -1,5 +1,5 @@
 /* Complex tangent function for float.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,19 @@ __ctanf (__complex__ float x)
 
       den = cos2rx + __ieee754_coshf (2.0 * __imag__ x);
 
-      __real__ res = sin2rx / den;
-      __imag__ res = __ieee754_sinhf (2.0 * __imag__ x) / den;
+
+      if (den == 0.0)
+	{
+	  __complex__ float ez = __cexpf (1.0i * x);
+	  __complex__ float emz = __cexpf (-1.0i * x);
+
+	  res = (ez - emz) / (ez + emz) * -1.0i;
+	}
+      else
+	{
+	  __real__ res = sin2rx / den;
+	  __imag__ res = __ieee754_sinhf (2.0 * __imag__ x) / den;
+	}
     }
 
   return res;
diff --git a/sysdeps/generic/s_ctanh.c b/sysdeps/generic/s_ctanh.c
index 971cd9040c..fe38dae291 100644
--- a/sysdeps/generic/s_ctanh.c
+++ b/sysdeps/generic/s_ctanh.c
@@ -1,5 +1,5 @@
 /* Complex hyperbole tangent for double.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,18 @@ __ctanh (__complex__ double x)
 
       den = (__ieee754_cosh (2.0 * __real__ x) + cos2ix);
 
-      __real__ res = __ieee754_sinh (2.0 * __real__ x) / den;
-      __imag__ res = sin2ix / den;
+      if (den == 0.0)
+	{
+	  __complex__ double ez = __cexp (x);
+	  __complex__ double emz = __cexp (-x);
+
+	  res = (ez - emz) / (ez + emz);
+	}
+      else
+	{
+	  __real__ res = __ieee754_sinh (2.0 * __real__ x) / den;
+	  __imag__ res = sin2ix / den;
+	}
     }
 
   return res;
diff --git a/sysdeps/generic/s_ctanhf.c b/sysdeps/generic/s_ctanhf.c
index cfcabab36a..c331dbaabb 100644
--- a/sysdeps/generic/s_ctanhf.c
+++ b/sysdeps/generic/s_ctanhf.c
@@ -1,5 +1,5 @@
 /* Complex hyperbole tangent for float.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,18 @@ __ctanhf (__complex__ float x)
 
       den = (__ieee754_coshf (2.0 * __real__ x) + cos2ix);
 
-      __real__ res = __ieee754_sinhf (2.0 * __real__ x) / den;
-      __imag__ res = sin2ix / den;
+      if (den == 0.0f)
+	{
+	  __complex__ float ez = __cexpf (x);
+	  __complex__ float emz = __cexpf (-x);
+
+	  res = (ez - emz) / (ez + emz);
+	}
+      else
+	{
+	  __real__ res = __ieee754_sinhf (2.0 * __real__ x) / den;
+	  __imag__ res = sin2ix / den;
+	}
     }
 
   return res;
diff --git a/sysdeps/generic/s_ctanhl.c b/sysdeps/generic/s_ctanhl.c
index 7bf6b39199..77ca8f8717 100644
--- a/sysdeps/generic/s_ctanhl.c
+++ b/sysdeps/generic/s_ctanhl.c
@@ -1,5 +1,5 @@
 /* Complex hyperbole tangent for long double.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,18 @@ __ctanhl (__complex__ long double x)
 
       den = (__ieee754_coshl (2.0 * __real__ x) + cos2ix);
 
-      __real__ res = __ieee754_sinhl (2.0 * __real__ x) / den;
-      __imag__ res = sin2ix / den;
+      if (den == 0.0L)
+	{
+	  __complex__ long double ez = __cexpl (x);
+	  __complex__ long double emz = __cexpl (-x);
+
+	  res = (ez - emz) / (ez + emz);
+	}
+      else
+	{
+	  __real__ res = __ieee754_sinhl (2.0 * __real__ x) / den;
+	  __imag__ res = sin2ix / den;
+	}
     }
 
   return res;
diff --git a/sysdeps/generic/s_ctanl.c b/sysdeps/generic/s_ctanl.c
index fa153e9b35..89379a5ff9 100644
--- a/sysdeps/generic/s_ctanl.c
+++ b/sysdeps/generic/s_ctanl.c
@@ -1,5 +1,5 @@
 /* Complex tangent function for long double.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -61,8 +61,19 @@ __ctanl (__complex__ long double x)
 
       den = cos2rx + __ieee754_coshl (2.0 * __imag__ x);
 
-      __real__ res = sin2rx / den;
-      __imag__ res = __ieee754_sinhl (2.0 * __imag__ x) / den;
+
+      if (den == 0.0)
+	{
+	  __complex__ long double ez = __cexpl (1.0i * x);
+	  __complex__ long double emz = __cexpl (-1.0i * x);
+
+	  res = (ez - emz) / (ez + emz) * -1.0i;
+	}
+      else
+	{
+	  __real__ res = sin2rx / den;
+	  __imag__ res = __ieee754_sinhl (2.0 * __imag__ x) / den;
+	}
     }
 
   return res;