Skip to content

Commit 0684806

Browse files
committed
feature tests: signbit detection fix for ia64
An Intel Itanium fix from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-ia64.dif
1 parent 7a6980a commit 0684806

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎src/cmd/ksh93/features/math.sh‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ echo "#include "
135135
case $_hdr_ieeefp in
136136
1) echo "#include " ;;
137137
esac
138+
cat <<!
139+
#if defined(__ia64__) && defined(signbit)
140+
# if defined __GNUC__ && __GNUC__ >= 4
141+
# define __signbitl(f) __builtin_signbitl(f)
142+
# else
143+
# include
144+
# if _lib_copysignl
145+
# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0)
146+
# endif
147+
# endif
148+
#endif
149+
!
138150
echo
139151

140152
: generate the intercept functions and table entries

‎src/lib/libast/sfio/sfcvt.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ static char *Zero = "0";
5555
#endif
5656
#endif
5757

58+
#if defined(__ia64__) && defined(signbit)
59+
# if defined __GNUC__ && __GNUC__ >= 4
60+
# define __signbitl(f) __builtin_signbitl(f)
61+
# else
62+
# if _lib_copysignl
63+
# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0)
64+
# endif
65+
# endif
66+
#endif
67+
5868
#if !_lib_signbit
5969
#if !_ast_fltmax_double
6070
static int neg0ld(Sfdouble_t f)

0 commit comments

Comments
 (0)