summary refs log tree commit diff
path: root/sysdeps/ia64/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ia64/fpu')
-rw-r--r--sysdeps/ia64/fpu/lgamma-compat.h42
-rw-r--r--sysdeps/ia64/fpu/w_lgamma_main.c (renamed from sysdeps/ia64/fpu/w_lgamma.c)27
-rw-r--r--sysdeps/ia64/fpu/w_lgammaf_main.c (renamed from sysdeps/ia64/fpu/w_lgammaf.c)25
-rw-r--r--sysdeps/ia64/fpu/w_lgammal_main.c (renamed from sysdeps/ia64/fpu/w_lgammal.c)25
4 files changed, 70 insertions, 49 deletions
diff --git a/sysdeps/ia64/fpu/lgamma-compat.h b/sysdeps/ia64/fpu/lgamma-compat.h
new file mode 100644
index 0000000000..f9748393b7
--- /dev/null
+++ b/sysdeps/ia64/fpu/lgamma-compat.h
@@ -0,0 +1,42 @@
+/* ABI compatibility for lgamma functions.  ia64 version.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef IA64_LGAMMA_COMPAT_H
+#define IA64_LGAMMA_COMPAT_H 1
+
+#include <math/lgamma-compat.h>
+
+#undef LGFUNC
+#if USE_AS_COMPAT
+# define LGFUNC(FUNC) __ ## FUNC ## _compat
+#else
+# define LGFUNC(FUNC) __ieee754_ ## FUNC
+#endif
+
+#undef CALL_LGAMMA
+#define CALL_LGAMMA(TYPE, FUNC, ARG)				\
+  ({								\
+    TYPE lgamma_tmp;						\
+    extern int __signgam, signgam;				\
+    lgamma_tmp = FUNC ((ARG), &__signgam, sizeof (__signgam));	\
+    if (USE_AS_COMPAT)						\
+      signgam = __signgam;					\
+    lgamma_tmp;							\
+  })
+
+#endif /* lgamma-compat.h.  */
diff --git a/sysdeps/ia64/fpu/w_lgamma.c b/sysdeps/ia64/fpu/w_lgamma_main.c
index 2006d3e806..6deffad987 100644
--- a/sysdeps/ia64/fpu/w_lgamma.c
+++ b/sysdeps/ia64/fpu/w_lgamma_main.c
@@ -53,28 +53,21 @@
 
 #include "libm_support.h"
 
+#include <lgamma-compat.h>
 
 extern double __libm_lgamma(double /*x*/, int* /*signgam*/, int /*signgamsz*/);
 
 
-double __ieee754_lgamma(double x)
+double LGFUNC (lgamma) (double x)
 {
-#ifdef __POSIX__
-    extern int    signgam;
-#else
-    int    signgam;
-#endif
-    return __libm_lgamma(x, &signgam, sizeof(signgam));
+    return CALL_LGAMMA (double, __libm_lgamma, x);
 }
-weak_alias (__ieee754_lgamma, lgamma)
-
-double __ieee754_gamma(double x)
-{
-#ifdef __POSIX__
-    extern int    signgam;
+#if USE_AS_COMPAT
+compat_symbol (libm, __lgammaf_compat, lgammaf, LGAMMA_OLD_VER);
 #else
-    int    signgam;
+versioned_symbol (libm, __ieee754_lgammaf, lgammaf, LGAMMA_NEW_VER);
+#endif
+#if GAMMA_ALIAS
+strong_alias (LGFUNC (lgammaf), __ieee754_gammaf)
+weak_alias (__ieee754_gammaf, gammaf)
 #endif
-    return __libm_lgamma(x, &signgam, sizeof(signgam));
-}
-weak_alias (__ieee754_gamma, gamma)
diff --git a/sysdeps/ia64/fpu/w_lgammaf.c b/sysdeps/ia64/fpu/w_lgammaf_main.c
index cd0b4f6666..d8e86a6f25 100644
--- a/sysdeps/ia64/fpu/w_lgammaf.c
+++ b/sysdeps/ia64/fpu/w_lgammaf_main.c
@@ -53,28 +53,21 @@
 
 #include "libm_support.h"
 
+#include <lgamma-compat.h>
 
 extern float  __libm_lgammaf(float /*x*/, int* /*signgam*/, int /*signgamsz*/);
 
 
-float __ieee754_lgammaf(float x)
+float LGFUNC (lgammaf) (float x)
 {
-#ifdef __POSIX__
-    extern int    signgam;
-#else
-    int    signgam;
-#endif
-    return __libm_lgammaf(x, &signgam, sizeof(signgam));
+    return CALL_LGAMMA (float, __libm_lgammaf, x);
 }
-weak_alias (__ieee754_lgammaf, lgammaf)
-
-float __ieee754_gammaf(float x)
-{
-#ifdef __POSIX__
-    extern int    signgam;
+#if USE_AS_COMPAT
+compat_symbol (libm, __lgammaf_compat, lgammaf, LGAMMA_OLD_VER);
 #else
-    int    signgam;
+versioned_symbol (libm, __ieee754_lgammaf, lgammaf, LGAMMA_NEW_VER);
 #endif
-    return __libm_lgammaf(x, &signgam, sizeof(signgam));
-}
+#if GAMMA_ALIAS
+strong_alias (LGFUNC (lgammaf), __ieee754_gammaf)
 weak_alias (__ieee754_gammaf, gammaf)
+#endif
diff --git a/sysdeps/ia64/fpu/w_lgammal.c b/sysdeps/ia64/fpu/w_lgammal_main.c
index e3885296eb..5c73f33430 100644
--- a/sysdeps/ia64/fpu/w_lgammal.c
+++ b/sysdeps/ia64/fpu/w_lgammal_main.c
@@ -55,25 +55,18 @@
 
 extern double __libm_lgammal(long double /*x*/, int* /*signgam*/, int /*signgamsz*/);
 
+#include <lgamma-compat.h>
 
-long double __ieee754_lgammal(long double x)
+long double LGFUNC (lgammal) (long double x)
 {
-#ifdef __POSIX__
-    extern int    signgam;
-#else
-    int    signgam;
-#endif
-    return __libm_lgammal(x, &signgam, sizeof(signgam));
+    return CALL_LGAMMA (long double, __libm_lgammal, x);
 }
-weak_alias (__ieee754_lgammal, lgammal)
-
-long double __ieee754_gammal(long double x)
-{
-#ifdef __POSIX__
-    extern int    signgam;
+#if USE_AS_COMPAT
+compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
 #else
-    int    signgam;
+versioned_symbol (libm, __ieee754_lgammal, lgammal, LGAMMA_NEW_VER);
 #endif
-    return __libm_lgammal(x, &signgam, sizeof(signgam));
-}
+#if GAMMA_ALIAS
+strong_alias (LGFUNC (lgammal), __ieee754_gammal)
 weak_alias (__ieee754_gammal, gammal)
+#endif