Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit abe41f4

Browse files
committed
Assume that we have cbrt().
Windows has this, and so do all other live platforms according to the buildfarm, so remove the configure probe and float.c's substitute code. This is part of a series of commits to get rid of no-longer-relevant configure checks and dead src/port/ code. I'm committing them separately to make it easier to back out individual changes if they prove less portable than I expect. Discussion: https://postgr.es/m/15379.1582221614@sss.pgh.pa.us
1 parent 7fde892 commit abe41f4

File tree

5 files changed

+1
-44
lines changed

5 files changed

+1
-44
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -14925,7 +14925,7 @@ fi
1492514925
LIBS_including_readline="$LIBS"
1492614926
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
1492714927

14928-
for ac_func in backtrace_symbols cbrt clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s memmove poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale utime utimes wcstombs_l
14928+
for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s memmove poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale utime utimes wcstombs_l
1492914929
do :
1493014930
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1493114931
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

configure.in

-1
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,6 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
16181618

16191619
AC_CHECK_FUNCS(m4_normalize([
16201620
backtrace_symbols
1621-
cbrt
16221621
clock_gettime
16231622
copyfile
16241623
fdatasync

src/backend/utils/adt/float.c

-38
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ static double sind_q1(double x);
7272
static double cosd_q1(double x);
7373
static void init_degree_constants(void);
7474

75-
#ifndef HAVE_CBRT
76-
/*
77-
* Some machines (in particular, some versions of AIX) have an extern
78-
* declaration for cbrt() in <math.h> but fail to provide the actual
79-
* function, which causes configure to not set HAVE_CBRT. Furthermore,
80-
* their compilers spit up at the mismatch between extern declaration
81-
* and static definition. We work around that here by the expedient
82-
* of a #define to make the actual name of the static function different.
83-
*/
84-
#define cbrt my_cbrt
85-
static double cbrt(double x);
86-
#endif /* HAVE_CBRT */
87-
8875

8976
/*
9077
* We use these out-of-line ereport() calls to report float overflow,
@@ -3964,28 +3951,3 @@ width_bucket_float8(PG_FUNCTION_ARGS)
39643951

39653952
PG_RETURN_INT32(result);
39663953
}
3967-
3968-
/* ========== PRIVATE ROUTINES ========== */
3969-
3970-
#ifndef HAVE_CBRT
3971-
3972-
static double
3973-
cbrt(double x)
3974-
{
3975-
int isneg = (x < 0.0);
3976-
double absx = fabs(x);
3977-
double tmpres = pow(absx, (double) 1.0 / (double) 3.0);
3978-
3979-
/*
3980-
* The result is somewhat inaccurate --- not really pow()'s fault, as the
3981-
* exponent it's handed contains roundoff error. We can improve the
3982-
* accuracy by doing one iteration of Newton's formula. Beware of zero
3983-
* input however.
3984-
*/
3985-
if (tmpres > 0.0)
3986-
tmpres -= (tmpres - absx / (tmpres * tmpres)) / (double) 3.0;
3987-
3988-
return isneg ? -tmpres : tmpres;
3989-
}
3990-
3991-
#endif /* !HAVE_CBRT */

src/include/pg_config.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@
101101
/* Define to 1 if you have the `BIO_meth_new' function. */
102102
#undef HAVE_BIO_METH_NEW
103103

104-
/* Define to 1 if you have the `cbrt' function. */
105-
#undef HAVE_CBRT
106-
107104
/* Define to 1 if you have the `clock_gettime' function. */
108105
#undef HAVE_CLOCK_GETTIME
109106

src/tools/msvc/Solution.pm

-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ sub GenerateFiles
210210
HAVE_BACKTRACE_SYMBOLS => undef,
211211
HAVE_BIO_GET_DATA => undef,
212212
HAVE_BIO_METH_NEW => undef,
213-
HAVE_CBRT => undef,
214213
HAVE_CLOCK_GETTIME => undef,
215214
HAVE_COMPUTED_GOTO => undef,
216215
HAVE_COPYFILE => undef,

0 commit comments

Comments
 (0)