Merge pull request #4379 from Diapolo/cleanup_compat

small cleanup in src/compat .h and .cpp
This commit is contained in:
Jeff Garzik 2014-06-21 16:29:12 -04:00
commit b4ccf0a5c7
5 changed files with 58 additions and 29 deletions

View File

@ -1,6 +1,15 @@
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "bitcoin-config.h"
#endif
#include <cstddef>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>
#endif
// Prior to GLIBC_2.14, memcpy was aliased to memmove.
extern "C" void* memmove(void* a, const void* b, size_t c);

View File

@ -1,4 +1,10 @@
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "bitcoin-config.h"
#endif
#include <cstddef>
#if defined(HAVE_SYS_SELECT_H)

View File

@ -1,3 +1,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <cstddef>
#include <istream>
#include <stdexcept>
@ -35,6 +39,7 @@ struct _List_node_base
__position->_M_prev->_M_next = this;
__position->_M_prev = this;
}
void _M_unhook() __attribute__((used))
{
_List_node_base* const __next_node = _M_next;
@ -42,6 +47,7 @@ struct _List_node_base
__prev_node->_M_next = __next_node;
__next_node->_M_prev = __prev_node;
}
_List_node_base* _M_next;
_List_node_base* _M_prev;
};
@ -61,8 +67,8 @@ out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT { }
// Used with permission.
// See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d
void
ctype<char>::_M_widen_init() const {
void ctype<char>::_M_widen_init() const
{
char __tmp[sizeof(_M_widen)];
for (unsigned __i = 0; __i < sizeof(_M_widen); ++__i)
__tmp[__i] = __i;

View File

@ -1,5 +1,9 @@
#include <locale>
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <list>
#include <locale>
#include <stdexcept>
namespace{

View File

@ -1,7 +1,11 @@
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCON_COMPAT_SANITY_H
#define BITCON_COMPAT_SANITY_H
bool glibc_sanity_test();
bool glibcxx_sanity_test();
#endif
#endif // BITCON_COMPAT_SANITY_H