From 548121d366e4e83c527901354f1a1b3388507328 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 29 Mar 2022 08:09:32 +0100 Subject: [PATCH] merge bitcoin#24704: remove strnlen back-compat code --- configure.ac | 1 - src/Makefile.am | 1 - src/compat.h | 4 ---- src/compat/strnlen.cpp | 18 ------------------ 4 files changed, 24 deletions(-) delete mode 100644 src/compat/strnlen.cpp diff --git a/configure.ac b/configure.ac index 499f539ceb..7ad8aa107b 100644 --- a/configure.ac +++ b/configure.ac @@ -1048,7 +1048,6 @@ AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],, [#include #include ] ) -AC_CHECK_DECLS([strnlen]) dnl These are used for daemonization in dashd AC_CHECK_DECLS([fork]) diff --git a/src/Makefile.am b/src/Makefile.am index 55ffd7a6c6..7dfa2c6073 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -792,7 +792,6 @@ libbitcoin_util_a_SOURCES = \ support/lockedpool.cpp \ chainparamsbase.cpp \ clientversion.cpp \ - compat/strnlen.cpp \ fs.cpp \ interfaces/echo.cpp \ interfaces/handler.cpp \ diff --git a/src/compat.h b/src/compat.h index 41f2cd7398..e2f784b96f 100644 --- a/src/compat.h +++ b/src/compat.h @@ -81,10 +81,6 @@ typedef int32_t ssize_t; #endif #endif -#if HAVE_DECL_STRNLEN == 0 -size_t strnlen( const char *start, size_t max_len); -#endif // HAVE_DECL_STRNLEN - #ifndef WIN32 typedef void* sockopt_arg_type; #else diff --git a/src/compat/strnlen.cpp b/src/compat/strnlen.cpp deleted file mode 100644 index 72b69953d0..0000000000 --- a/src/compat/strnlen.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#if defined(HAVE_CONFIG_H) -#include -#endif - -#include - -#if HAVE_DECL_STRNLEN == 0 -size_t strnlen( const char *start, size_t max_len) -{ - const char *end = (const char *)memchr(start, '\0', max_len); - - return end ? (size_t)(end - start) : max_len; -} -#endif // HAVE_DECL_STRNLEN \ No newline at end of file