Changeset View
Changeset View
Standalone View
Standalone View
src/compat/glibc_compat.cpp
// Copyright (c) 2009-2014 The Bitcoin Core developers | // Copyright (c) 2009-2014 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include <config/bitcoin-config.h> | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#include <cstdarg> | #include <cstdarg> | ||||
#include <cstddef> | #include <cstddef> | ||||
#include <cstdint> | #include <cstdint> | ||||
#if defined(HAVE_SYS_SELECT_H) | |||||
#include <sys/select.h> | |||||
#endif | |||||
// Prior to GLIBC_2.14, memcpy was aliased to memmove. | // Prior to GLIBC_2.14, memcpy was aliased to memmove. | ||||
extern "C" void *memmove(void *a, const void *b, size_t c); | extern "C" void *memmove(void *a, const void *b, size_t c); | ||||
extern "C" void *memcpy(void *a, const void *b, size_t c) { | extern "C" void *memcpy(void *a, const void *b, size_t c) { | ||||
return memmove(a, b, c); | return memmove(a, b, c); | ||||
} | } | ||||
extern "C" void __chk_fail(void) __attribute__((__noreturn__)); | |||||
extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a) { | |||||
if (a >= FD_SETSIZE) __chk_fail(); | |||||
return a / __NFDBITS; | |||||
} | |||||
extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) | |||||
__attribute__((weak, alias("__fdelt_warn"))); | |||||
#if defined(__i386__) || defined(__arm__) | #if defined(__i386__) || defined(__arm__) | ||||
extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t *rp); | extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t *rp); | ||||
extern "C" int64_t __wrap___divmoddi4(int64_t u, int64_t v, int64_t *rp) { | extern "C" int64_t __wrap___divmoddi4(int64_t u, int64_t v, int64_t *rp) { | ||||
int32_t c1 = 0, c2 = 0; | int32_t c1 = 0, c2 = 0; | ||||
int64_t uu = u, vv = v; | int64_t uu = u, vv = v; | ||||
int64_t w; | int64_t w; | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |