From 7ea396ab3f9edec0158bb6eab34924f1cb5e14ed Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 7 Jul 2020 17:58:21 -0700 Subject: [PATCH] Remove lrand48 checks and support lrand48 is no longer used. --- cmake/ConfigureChecks.cmake | 1 - config_cmake.h.in | 3 --- src/fallback.cpp | 3 +-- src/fallback.h | 16 ---------------- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 9a2205de9..eb380c342 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -80,7 +80,6 @@ check_cxx_symbol_exists(getpwent pwd.h HAVE_GETPWENT) check_cxx_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE) check_cxx_symbol_exists(gettext libintl.h HAVE_GETTEXT) check_cxx_symbol_exists(killpg "sys/types.h;signal.h" HAVE_KILLPG) -check_cxx_symbol_exists(lrand48_r stdlib.h HAVE_LRAND48_R) # mkostemp is in stdlib in glibc and FreeBSD, but unistd on macOS check_cxx_symbol_exists(mkostemp "stdlib.h;unistd.h" HAVE_MKOSTEMP) set(HAVE_CURSES_H ${CURSES_HAVE_CURSES_H}) diff --git a/config_cmake.h.in b/config_cmake.h.in index de86ab185..0d839ca9c 100644 --- a/config_cmake.h.in +++ b/config_cmake.h.in @@ -43,9 +43,6 @@ /* Define to 1 if you have the `killpg' function. */ #cmakedefine HAVE_KILLPG 1 -/* Define to 1 if you have the `lrand48_r' function. */ -#cmakedefine HAVE_LRAND48_R 1 - /* Define to 1 if you have the `mkostemp' function. */ #cmakedefine HAVE_MKOSTEMP 1 diff --git a/src/fallback.cpp b/src/fallback.cpp index 146124539..47663837b 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -1,8 +1,7 @@ // This file only contains fallback implementations of functions which have been found to be missing // or broken by the configuration scripts. // -// Many of these functions are more or less broken and incomplete. lrand28_r internally uses the -// regular (bad) rand_r function, the gettext function doesn't actually do anything, etc. +// Many of these functions are more or less broken and incomplete. #include "config.h" // IWYU likes to recommend adding term.h when we want ncurses.h. diff --git a/src/fallback.h b/src/fallback.h index 2ca1ef42e..a3fc8c489 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -126,22 +126,6 @@ wchar_t *wcsndup(const wchar_t *in, size_t c); size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz); #endif -#if 0 -// These are not currently used. -#ifndef HAVE_LRAND48_R -/// Data structure for the lrand48_r fallback implementation. -struct drand48_data { - unsigned int seed; -}; - -/// Fallback implementation of lrand48_r. Internally uses rand_r, so it is pretty weak. -int lrand48_r(struct drand48_data *buffer, long int *result); - -/// Fallback implementation of srand48_r, the seed function for lrand48_r. -int srand48_r(long int seedval, struct drand48_data *buffer); -#endif -#endif - #ifndef HAVE_FUTIMES int futimes(int fd, const struct timeval *times); #endif