mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improve platform detection and reduce includes:
The existing platform detection code was derived from the old Beast library, which was, itself, derived from JUCE. This commit removes that code and replaces it with the Boost.Predef library which defines a consistent set of compiler, architecture, operating system, library, and other version numbers. For more on Boost.Predef, please see the Boost documentation. The documentation for the current version as of this writing is at: https://www.boost.org/doc/libs/1_71_0/doc/html/predef.html
This commit is contained in:
@@ -41,7 +41,7 @@ private:
|
||||
*state = 1;
|
||||
|
||||
// If there is an initial thread name then we failed.
|
||||
if (initialThreadName)
|
||||
if (!initialThreadName.empty())
|
||||
return;
|
||||
|
||||
// Wait until all threads have their names.
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
#include <ripple/beast/unit_test.h>
|
||||
|
||||
namespace beast {
|
||||
|
||||
// A simple unit test to determine the diagnostic settings in a build.
|
||||
//
|
||||
class Debug_test : public unit_test::suite
|
||||
{
|
||||
public:
|
||||
static int envDebug()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int beastDebug()
|
||||
{
|
||||
#ifdef BEAST_DEBUG
|
||||
return BEAST_DEBUG;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void run() override
|
||||
{
|
||||
log <<
|
||||
"_DEBUG = " << envDebug() << '\n' <<
|
||||
"BEAST_DEBUG = " << beastDebug() << '\n' <<
|
||||
"sizeof(std::size_t) = " << sizeof(std::size_t) << std::endl;
|
||||
pass();
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(Debug, utility, beast);
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <test/unit_test/FileDirGuard.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/predef.h>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
|
||||
@@ -24,6 +24,5 @@
|
||||
#include <test/beast/beast_basic_seconds_clock_test.cpp>
|
||||
#include <test/beast/beast_io_latency_probe_test.cpp>
|
||||
#include <test/beast/beast_CurrentThreadName_test.cpp>
|
||||
#include <test/beast/beast_Debug_test.cpp>
|
||||
#include <test/beast/beast_Journal_test.cpp>
|
||||
#include <test/beast/beast_PropertyStream_test.cpp>
|
||||
|
||||
Reference in New Issue
Block a user