compat: remove strnlen back-compat code

This was needed for mingw (not mingw-w64), and some older versions of
macOS, which we no-longer support.
24.x
fanquake 3 years ago
parent 7c72eabb57
commit d4ba2b2cbc
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -125,10 +125,6 @@
don't. */
#define HAVE_DECL_STRERROR_R 0
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
don't. */
#define HAVE_DECL_STRNLEN 1
/* Define if the dllexport attribute is supported. */
#define HAVE_DLLEXPORT_ATTRIBUTE 1

@ -984,7 +984,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 bitcoind
AC_CHECK_DECLS([fork])

@ -606,7 +606,6 @@ libbitcoin_util_a_SOURCES = \
chainparamsbase.cpp \
clientversion.cpp \
compat/glibcxx_sanity.cpp \
compat/strnlen.cpp \
fs.cpp \
interfaces/echo.cpp \
interfaces/handler.cpp \

@ -80,10 +80,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

@ -1,18 +0,0 @@
// Copyright (c) 2009-2018 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
Loading…
Cancel
Save