From 81f187cbd9b770fce374ee37a028e62aa84d7bbd Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 10 Dec 2024 13:15:06 -0500 Subject: [PATCH] stdlib.h: Remove *rand48_r methods. These were declared in this header on BeOS, so we need to keep them around for ABI compatibility, but they are nonstandard and no other C library besides glibc appears to provide them at all (not even musl, and none of the BSDs.) --- headers/posix/stdlib.h | 23 ------------------- src/system/libroot/posix/glibc/stdlib/Jamfile | 18 ++++++++------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/headers/posix/stdlib.h b/headers/posix/stdlib.h index e0e4f7b5f4..955bb69858 100644 --- a/headers/posix/stdlib.h +++ b/headers/posix/stdlib.h @@ -31,14 +31,6 @@ struct random_data { int *end_ptr; }; -struct drand48_data { - unsigned short int x[3]; - unsigned short int a[3]; - unsigned short int c; - unsigned short int old_x[3]; - int init; -}; - #ifdef __cplusplus extern "C" { @@ -126,21 +118,6 @@ extern void srand48(long int seed); extern unsigned short *seed48(unsigned short int seed16v[3]); extern void lcong48(unsigned short int param[7]); -extern int drand48_r(struct drand48_data *data, double *result); -extern int erand48_r(unsigned short int xsubi[3], - struct drand48_data *data, double *result); -extern int lrand48_r(struct drand48_data *data, long int *result); -extern int nrand48_r(unsigned short int xsubi[3], - struct drand48_data *data, long int *result); -extern int mrand48_r(struct drand48_data *data, long int *result); -extern int jrand48_r(unsigned short int xsubi[3], - struct drand48_data *data, long int *result); -extern int srand48_r(long int seed, struct drand48_data *data); -extern int seed48_r(unsigned short int seed16v[3], - struct drand48_data *data); -extern int lcong48_r(unsigned short int param[7], - struct drand48_data *data); - /* search and sort functions */ typedef int (*_compare_function)(const void *, const void *); diff --git a/src/system/libroot/posix/glibc/stdlib/Jamfile b/src/system/libroot/posix/glibc/stdlib/Jamfile index f74052246b..215c764896 100644 --- a/src/system/libroot/posix/glibc/stdlib/Jamfile +++ b/src/system/libroot/posix/glibc/stdlib/Jamfile @@ -24,27 +24,29 @@ for architectureObject in [ MultiArchSubDirSetup ] { drand48_r.c drand48-iter.c erand48.c - erand48_r.c fpioconst.c jrand48.c - jrand48_r.c inlines.c lcong48.c - lcong48_r.c lrand48.c - lrand48_r.c mrand48.c - mrand48_r.c nrand48.c - nrand48_r.c random_r.c seed48.c - seed48_r.c srand48.c - srand48_r.c strtod.c strtold.c strtof.c + + # These are nonstandard but were declared in BeOS's headers. + erand48_r.c + jrand48_r.c + lcong48_r.c + lrand48_r.c + mrand48_r.c + nrand48_r.c + seed48_r.c + srand48_r.c ; } }