stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork

This commit is contained in:
2026-02-24 18:38:47 +00:00
parent da8c28aaeb
commit 65cb2619a7
13106 changed files with 2484322 additions and 1804 deletions
@@ -0,0 +1,62 @@
// boost/endian/detail/config.hpp ----------------------------------------------------//
// Copyright Beman Dawes 2003, 2010
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
#ifndef BOOST_ENDIAN_CONFIG_HPP
#define BOOST_ENDIAN_CONFIG_HPP
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
#include <boost/config.hpp>
#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
// throw an exception ----------------------------------------------------------------//
//
// Exceptions were originally thrown via boost::throw_exception().
// As throw_exception() became more complex, it caused user error reporting
// to be harder to interpret, since the exception reported became much more complex.
// The immediate fix was to throw directly, wrapped in a macro to make any later change
// easier.
#define BOOST_ENDIAN_THROW(EX) throw EX
// enable dynamic linking -------------------------------------------------------------//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ENDIAN_DYN_LINK)
# if defined(BOOST_ENDIAN_SOURCE)
# define BOOST_ENDIAN_DECL BOOST_SYMBOL_EXPORT
# else
# define BOOST_ENDIAN_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_ENDIAN_DECL
#endif
// enable automatic library variant selection ----------------------------------------//
#if !defined(BOOST_ENDIAN_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
&& !defined(BOOST_ENDIAN_NO_LIB)
//
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_endian
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ENDIAN_DYN_LINK)
# define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif // auto-linking disabled
#endif // BOOST_ENDIAN_CONFIG_HPP
@@ -0,0 +1,142 @@
// boost/endian/detail/cover_operators.hpp ----------------------------------//
// Copyright Darin Adler 2000
// Copyright Beman Dawes 2008
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ENDIAN_COVER_OPERATORS_HPP
#define BOOST_ENDIAN_COVER_OPERATORS_HPP
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4365) // conversion ... signed/unsigned mismatch
#endif
# ifndef BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
# include <boost/operators.hpp>
# endif
#include <boost/config.hpp>
#include <iosfwd>
namespace boost
{
namespace endian
{
//--------------------------------------------------------------------------------------//
// A class that adds arithmetic operators to an arithmetic cover class
//
// Uses the curiously recurring template pattern (CRTP).
//
// If the class being covered has a non-explicit conversion to an integer type
// then a smaller number of cover operations are needed. Define the macro
// BOOST_ENDIAN_MINIMAL_COVER_OPERATORS to indicate this.
//
// Define BOOST_NO_IO_COVER_OPERATORS if I/O cover operations are not desired.
//--------------------------------------------------------------------------------------//
template <class D, // D is the CRTP derived type, i.e. the cover class
class ArithmeticT>
class cover_operators
# ifndef BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
: boost::operators<D>
# endif
{
// The other operations take advantage of the type conversion that's
// built into unary +.
// Unary operations.
friend ArithmeticT operator+(const D& x) BOOST_NOEXCEPT { return x; }
# ifndef BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
friend ArithmeticT operator-(const D& x) BOOST_NOEXCEPT { return -+x; }
friend ArithmeticT operator~(const D& x) BOOST_NOEXCEPT { return ~+x; }
friend ArithmeticT operator!(const D& x) BOOST_NOEXCEPT { return !+x; }
// The basic ordering operations.
friend bool operator==(const D& x, ArithmeticT y) BOOST_NOEXCEPT { return +x == y; }
friend bool operator<(const D& x, ArithmeticT y) BOOST_NOEXCEPT { return +x < y; }
# endif
// The basic arithmetic operations.
friend D& operator+=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x + y); }
friend D& operator-=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x - y); }
friend D& operator*=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x * y); }
friend D& operator/=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x / y); }
friend D& operator%=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x % y); }
friend D& operator&=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x & y); }
friend D& operator|=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x | y); }
friend D& operator^=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x ^ y); }
friend D& operator<<=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x << y); }
friend D& operator>>=(D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return x = static_cast<ArithmeticT>(+x >> y); }
// A few binary arithmetic operations not covered by operators base class.
friend ArithmeticT operator<<(const D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return static_cast<ArithmeticT>(+x << y); }
friend ArithmeticT operator>>(const D& x, ArithmeticT y) BOOST_NOEXCEPT
{ return static_cast<ArithmeticT>(+x >> y); }
// Auto-increment and auto-decrement can be defined in terms of the
// arithmetic operations.
friend D& operator++(D& x) BOOST_NOEXCEPT { return x += 1; }
friend D& operator--(D& x) BOOST_NOEXCEPT { return x -= 1; }
# ifdef BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
friend D operator++(D& x, int) BOOST_NOEXCEPT
{
D tmp(x);
x += 1;
return tmp;
}
friend D operator--(D& x, int) BOOST_NOEXCEPT
{
D tmp(x);
x -= 1;
return tmp;
}
# endif
# ifndef BOOST_NO_IO_COVER_OPERATORS
// Stream inserter
template <class charT, class traits>
friend std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os, const D& x)
{
return os << +x;
}
// Stream extractor
template <class charT, class traits>
friend std::basic_istream<charT, traits>&
operator>>(std::basic_istream<charT, traits>& is, D& x)
{
ArithmeticT i;
if (is >> i)
x = i;
return is;
}
# endif
};
} // namespace endian
} // namespace boost
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif // BOOST_ENDIAN_COVER_OPERATORS_HPP
@@ -0,0 +1,33 @@
// disable_warnings.hpp --------------------------------------------------------------//
// Copyright Beman Dawes 2011
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
#ifdef _MSC_VER
#ifndef _SCL_SECURE_NO_WARNINGS
# define _SCL_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
# pragma warning(push)
// triggered by boost/detail/lightweight_test.hpp
# pragma warning( disable : 4640 ) // ... construction of local static object is not thread-safe
// triggered by Microsoft's own headers, so disable
# pragma warning( disable : 4820 ) // padding added after data member
# pragma warning( disable : 4548 ) // expression before comma has no effect
# pragma warning( disable : 4668 ) // ... is not defined as a preprocessor macro
# pragma warning( disable : 4514 ) // ... unreferenced inline function has been removed
# pragma warning( disable : 4710 ) // ... function not inlined
# pragma warning( disable : 4986 ) // ... exception specification does not match previous declaration
# pragma warning( disable : 4711 ) // ... selected for automatic inline expansion
#endif
@@ -0,0 +1,12 @@
// disable_warnings_pop.hpp ----------------------------------------------------------//
// Copyright Beman Dawes 2011
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
#ifdef _MSC_VER
# pragma warning(push)
#endif
@@ -0,0 +1,67 @@
// endian/detail/intrinsic.hpp -------------------------------------------------------//
// Copyright (C) 2012 David Stone
// Copyright Beman Dawes 2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_ENDIAN_INTRINSIC_HPP
#define BOOST_ENDIAN_INTRINSIC_HPP
// Allow user to force BOOST_ENDIAN_NO_INTRINSICS in case they aren't available for a
// particular platform/compiler combination. Please report such platform/compiler
// combinations to the Boost mailing list.
#ifndef BOOST_ENDIAN_NO_INTRINSICS
#ifndef __has_builtin // Optional of course
#define __has_builtin(x) 0 // Compatibility with non-clang compilers
#endif
#if defined(_MSC_VER)
// Microsoft documents these as being compatible since Windows 95 and specifically
// lists runtime library support since Visual Studio 2003 (aka 7.1).
// Clang/c2 uses the Microsoft rather than GCC intrinsics, so we check for
// defined(_MSC_VER) before defined(__clang__)
# define BOOST_ENDIAN_INTRINSIC_MSG "cstdlib _byteswap_ushort, etc."
# include <cstdlib>
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) _byteswap_ushort(x)
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) _byteswap_ulong(x)
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) _byteswap_uint64(x)
// GCC and Clang recent versions provide intrinsic byte swaps via builtins
#elif (defined(__clang__) && __has_builtin(__builtin_bswap32) && __has_builtin(__builtin_bswap64)) \
|| (defined(__GNUC__ ) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
# define BOOST_ENDIAN_INTRINSIC_MSG "__builtin_bswap16, etc."
// prior to 4.8, gcc did not provide __builtin_bswap16 on some platforms so we emulate it
// see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624
// Clang has a similar problem, but their feature test macros make it easier to detect
# if (defined(__clang__) && __has_builtin(__builtin_bswap16)) \
|| (defined(__GNUC__) &&(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap16(x)
# else
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap32((x) << 16)
# endif
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) __builtin_bswap32(x)
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) __builtin_bswap64(x)
// Linux systems provide the byteswap.h header, with
#elif defined(__linux__)
// don't check for obsolete forms defined(linux) and defined(__linux) on the theory that
// compilers that predefine only these are so old that byteswap.h probably isn't present.
# define BOOST_ENDIAN_INTRINSIC_MSG "byteswap.h bswap_16, etc."
# include <byteswap.h>
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) bswap_16(x)
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) bswap_32(x)
# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) bswap_64(x)
#else
# define BOOST_ENDIAN_NO_INTRINSICS
# define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics"
#endif
#elif !defined(BOOST_ENDIAN_INTRINSIC_MSG)
# define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics"
#endif // BOOST_ENDIAN_NO_INTRINSICS
#endif // BOOST_ENDIAN_INTRINSIC_HPP
@@ -0,0 +1,223 @@
// boost/endian/detail/lightweight_test.hpp --------------------------------------------//
#ifndef BOOST_ENDIAN_LIGHTWEIGHT_TEST_HPP
#define BOOST_ENDIAN_LIGHTWEIGHT_TEST_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
//
// Copyright (c) 2002, 2009, 2014 Peter Dimov
// Copyright (2) Beman Dawes 2010, 2011, 2015
// Copyright (3) Ion Gaztanaga 2013
//
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/assert.hpp>
#include <boost/current_function.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <cstring> // for memcmp
#include <iostream>
// IDE's like Visual Studio perform better if output goes to std::cout or
// some other stream, so allow user to configure output stream:
#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
#endif
namespace boost
{
namespace endian
{
namespace detail
{
struct report_errors_reminder
{
bool called_report_errors_function;
report_errors_reminder() : called_report_errors_function(false) {}
~report_errors_reminder()
{
BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called
}
};
inline report_errors_reminder& report_errors_remind()
{
static report_errors_reminder r;
return r;
}
inline int & test_errors()
{
static int x = 0;
report_errors_remind();
return x;
}
inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test '" << expr << "' failed in function '"
<< function << "'" << std::endl;
++test_errors();
}
inline void error_impl(char const * msg, char const * file, int line, char const * function)
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): " << msg << " in function '"
<< function << "'" << std::endl;
++test_errors();
}
inline void throw_failed_impl(char const * excep, char const * file, int line, char const * function)
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): Exception '" << excep << "' not thrown in function '"
<< function << "'" << std::endl;
++test_errors();
}
template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2,
char const * file, int line, char const * function, T const & t, U const & u )
{
if( t == u )
{
report_errors_remind();
}
else
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test '" << expr1 << " == " << expr2
<< "' failed in function '" << function << "': "
<< "'" << t << "' != '" << u << "'" << std::endl;
++test_errors();
}
}
template<class T, class U> inline void test_ne_impl( char const * expr1, char const * expr2,
char const * file, int line, char const * function, T const & t, U const & u )
{
if( t != u )
{
report_errors_remind();
}
else
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test '" << expr1 << " != " << expr2
<< "' failed in function '" << function << "': "
<< "'" << t << "' == '" << u << "'" << std::endl;
++test_errors();
}
}
template <class T>
std::string to_hex(const T& x)
{
const char hex[] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' };
std::string tmp;
const unsigned char* p = reinterpret_cast<const unsigned char*>(&x);
const unsigned char* e = p + sizeof(T);
for (; p < e; ++p)
{
tmp += hex[*p >> 4]; // high-order nibble
tmp += hex[*p & 0x0f]; // low-order nibble
}
return tmp;
}
template<class T, class U> inline bool test_memcmp_eq_impl(char const * expr1,
char const * expr2, char const * file, int line, char const * function, T const & t,
U const & u)
{
BOOST_ASSERT(sizeof(T) == sizeof(U));
if (sizeof(T) == sizeof(U)
&& std::memcmp(&t, &u, sizeof(T)) == 0)
{
report_errors_remind();
return true;
}
else
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test 'std::memcmp(" << expr1 << ", " << expr2
<< ") == 0' fails in function '" << function << "': "
<< " with values '" << to_hex(t) << "' and '" << to_hex(u) << "'" << std::endl;
++test_errors();
return false;
}
}
} // namespace detail
inline int report_errors()
{
boost::endian::detail::report_errors_remind().called_report_errors_function = true;
int errors = boost::endian::detail::test_errors();
if( errors == 0 )
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "No errors detected." << std::endl;
return 0;
}
else
{
BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
return 1;
}
}
} // namespace endian
} // namespace boost
//////////////////////////////////////////////////////////////////////////////////////////
// TODO: Should all test macros return bool? See BOOST_TEST_MEM_EQ usage in fp_exaustive_test,cpp
//////////////////////////////////////////////////////////////////////////////////////////
#define BOOST_TEST(expr) \
((expr)? (void)0: ::boost::endian::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
#define BOOST_ERROR(msg) \
( ::boost::endian::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
#define BOOST_TEST_EQ(expr1,expr2) \
( ::boost::endian::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
#define BOOST_TEST_NE(expr1,expr2) \
( ::boost::endian::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
#define BOOST_TEST_MEM_EQ(expr1,expr2) \
(::boost::endian::detail::test_memcmp_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2))
#ifndef BOOST_NO_EXCEPTIONS
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
try { \
EXPR; \
::boost::detail::throw_failed_impl \
(#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
} \
catch(EXCEP const&) { \
} \
catch(...) { \
::boost::detail::throw_failed_impl \
(#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
} \
//
#else
#define BOOST_TEST_THROWS( EXPR, EXCEP )
#endif
#endif // #ifndef BOOST_ENDIAN_LIGHTWEIGHT_TEST_HPP