|
| 1 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 | +index 0a279c8..8e771ee 100644 |
| 3 | +--- a/CMakeLists.txt |
| 4 | ++++ b/CMakeLists.txt |
| 5 | +@@ -136,7 +136,7 @@ if (NOT MSVC) |
| 6 | + check_include_files(fcntl.h HAVE_FCNTL_H) |
| 7 | + check_function_exists(fpclass HAVE_FPCLASS) |
| 8 | + check_function_exists(ftime HAVE_FTIME) |
| 9 | +- check_function_exists(getentropy HAVE_GETENTROPY) |
| 10 | ++ check_symbol_exists(getentropy "sys/random.h" HAVE_GETENTROPY) |
| 11 | + check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) |
| 12 | + check_library_exists(history append_history "" HAVE_LIBHISTORY) |
| 13 | + check_library_exists(readline readline "" HAVE_LIBREADLINE) |
| 14 | +@@ -149,7 +149,6 @@ if (NOT MSVC) |
| 15 | + check_function_exists(stat HAVE_STAT) |
| 16 | + check_include_files(stdint.h HAVE_STDINT_H) |
| 17 | + check_include_files(sys/mman.h HAVE_SYS_MMAN_H) |
| 18 | +- check_include_files(sys/random.h HAVE_SYS_RANDOM_H) |
| 19 | + check_include_files(sys/select.h HAVE_SYS_SELECT_H) |
| 20 | + check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) |
| 21 | + check_include_files(sys/stat.h HAVE_SYS_STAT_H) |
| 22 | +diff --git a/config.h.cmake.in b/config.h.cmake.in |
| 23 | +index 2f4aeba..79f1cdb 100644 |
| 24 | +--- a/config.h.cmake.in |
| 25 | ++++ b/config.h.cmake.in |
| 26 | +@@ -69,9 +69,6 @@ |
| 27 | + /* Define to 1 if you have the <sys/mman.h> header file. */ |
| 28 | + #cmakedefine HAVE_SYS_MMAN_H 1 |
| 29 | + |
| 30 | +-/* Define to 1 if you have the <sys/random.h> header file. */ |
| 31 | +-#cmakedefine HAVE_SYS_RANDOM_H 1 |
| 32 | +- |
| 33 | + /* Define to 1 if you have the <sys/select.h> header file. */ |
| 34 | + #cmakedefine HAVE_SYS_SELECT_H 1 |
| 35 | + |
| 36 | +diff --git a/configure.ac b/configure.ac |
| 37 | +index 48cd2f0..0f09c61 100644 |
| 38 | +--- a/configure.ac |
| 39 | ++++ b/configure.ac |
| 40 | +@@ -304,7 +304,6 @@ AC_CHECK_HEADERS([stdint.h]) |
| 41 | + AC_CHECK_HEADERS([fcntl.h unistd.h sys/stat.h]) |
| 42 | + AC_CHECK_HEADERS([sys/mman.h]) |
| 43 | + AC_CHECK_HEADERS([sys/time.h sys/timeb.h]) |
| 44 | +-AC_CHECK_HEADERS([sys/random.h]) |
| 45 | + AC_CHECK_HEADERS([dl.h dlfcn.h]) |
| 46 | + AC_CHECK_HEADERS([glob.h]) |
| 47 | + AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes") |
| 48 | +@@ -317,9 +316,7 @@ AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ |
| 49 | + # undef /**/ HAVE_MMAP |
| 50 | + #endif]) |
| 51 | + |
| 52 | +-AC_CHECK_DECL([getentropy], |
| 53 | +- [AC_DEFINE([HAVE_GETENTROPY], [1], [getentropy])], [], |
| 54 | +- [#include <sys/random.h>]) |
| 55 | ++AC_CHECK_DECLS([getentropy], [], [], [#include <sys/random.h>]) |
| 56 | + |
| 57 | + dnl |
| 58 | + dnl Checks for inet libraries |
| 59 | +diff --git a/dict.c b/dict.c |
| 60 | +index 49e1c6b..46bb4d4 100644 |
| 61 | +--- a/dict.c |
| 62 | ++++ b/dict.c |
| 63 | +@@ -928,13 +928,11 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { |
| 64 | + #define WIN32_LEAN_AND_MEAN |
| 65 | + #include <windows.h> |
| 66 | + #include <bcrypt.h> |
| 67 | +-#elif defined(HAVE_GETENTROPY) |
| 68 | ++#elif HAVE_GETENTROPY |
| 69 | + #ifdef HAVE_UNISTD_H |
| 70 | + #include <unistd.h> |
| 71 | + #endif |
| 72 | +- #ifdef HAVE_SYS_RANDOM_H |
| 73 | +- #include <sys/random.h> |
| 74 | +- #endif |
| 75 | ++ #include <sys/random.h> |
| 76 | + #else |
| 77 | + #include <time.h> |
| 78 | + #endif |
| 79 | +@@ -965,7 +963,7 @@ xmlInitRandom(void) { |
| 80 | + "error code %lu\n", GetLastError()); |
| 81 | + abort(); |
| 82 | + } |
| 83 | +-#elif defined(HAVE_GETENTROPY) |
| 84 | ++#elif HAVE_GETENTROPY |
| 85 | + while (1) { |
| 86 | + if (getentropy(globalRngState, sizeof(globalRngState)) == 0) |
| 87 | + break; |
0 commit comments