merge bitcoin#24704: remove strnlen back-compat code

This commit is contained in:
Kittywhiskers Van Gogh 2022-03-29 08:09:32 +01:00
parent b65038ec94
commit 548121d366
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
4 changed files with 0 additions and 24 deletions

View File

@ -1048,7 +1048,6 @@ AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
[#include <sys/types.h>
#include <ifaddrs.h>]
)
AC_CHECK_DECLS([strnlen])
dnl These are used for daemonization in dashd
AC_CHECK_DECLS([fork])

View File

@ -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 \

View File

@ -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

View File

@ -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 <config/bitcoin-config.h>
#endif
#include <cstring>
#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