Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ set( with-tests "yes" CACHE BOOL "Compile with unit tests." )
#------------------------------------------------------------------------------
set( with-examples "yes" CACHE BOOL "Compile with examples." )

# Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}.
# Implement -Dwith-icu and define WITH_ICU and output ${icu}.
#------------------------------------------------------------------------------
set( with-icu "no" CACHE BOOL "Compile with International Components for Unicode." )

if (with-icu)
add_definitions( -DBOOST_HAS_ICU )
add_definitions( -DWITH_ICU )
endif()

if (with-icu)
Expand Down
5 changes: 1 addition & 4 deletions builds/msvc/vs2022/libbitcoin-system.import.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-system\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<!-- WITH_ICU always defined in Visual Studio builds. -->
<!-- NOMINMAX enables use of std::min/max without conflict. -->
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-system)' == 'static' Or '$(Linkage-libbitcoin-system)' == 'ltcg'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Enable use of CPU intrinsics. -->
Expand Down
5 changes: 1 addition & 4 deletions builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
<ClCompile>
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnablePREfast>false</EnablePREfast>
<!-- WITH_ICU always defined in Visual Studio builds. -->
<!-- NOMINMAX enables use of std::min/max without conflict. -->
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BC_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ AC_ARG_WITH([examples],
AC_MSG_RESULT([$with_examples])
AM_CONDITIONAL([WITH_EXAMPLES], [test x$with_examples != xno])

# Implement --with-icu and define BOOST_HAS_ICU and output ${icu}.
# Implement --with-icu and define WITH_ICU and output ${icu}.
#------------------------------------------------------------------------------
AC_MSG_CHECKING([--with-icu option])
AC_ARG_WITH([icu],
Expand All @@ -118,7 +118,7 @@ AC_ARG_WITH([icu],
[with_icu=$withval],
[with_icu=no])
AC_MSG_RESULT([$with_icu])
AS_CASE([${with_icu}], [yes], AC_DEFINE([BOOST_HAS_ICU]))
AS_CASE([${with_icu}], [yes], AC_DEFINE([WITH_ICU]))
AS_CASE([${with_icu}], [yes], AC_SUBST([icu], [-DWITH_ICU]))

# Implement --enable-avx2.
Expand Down
24 changes: 19 additions & 5 deletions include/bitcoin/system/boost.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,40 @@
#ifndef LIBBITCOIN_SYSTEM_BOOST_HPP
#define LIBBITCOIN_SYSTEM_BOOST_HPP

///////////////////////////////////////////////////////////////////////////////
// Include boost only here, so these definitions take hold within boost.
// Dependent projects must include <bitcoin/system.hpp> before any boost.
///////////////////////////////////////////////////////////////////////////////

#include <utility>

// Apply any warning suppressions to boost.
// Any boost includes within headers will not benefit from suppression, as the
// warnings are included by define.hpp which follows boost includes.
#include <bitcoin/system/warnings.hpp>

// Include boost only from here, so this exclusion works.
// Headers only containers.
#define BOOST_CONTAINER_NO_LIB

// Avoid namespace conflict between boost::placeholders and std::placeholders.
// This arises when including <functional>, which declares std::placeholders.
// www.boost.org/doc/libs/1_78_0/boost/bind.hpp
// Include boost only from here, so placeholders exclusion works.
#define BOOST_BIND_NO_PLACEHOLDERS
#include <boost/bind.hpp>

// Include boost only from here, so this definition works.
#if defined(HAVE_ICU)
#define BOOST_HAS_ICU
#endif
#include <boost/locale.hpp>

// address::from_string
////#define BOOST_ASIO_NO_DEPRECATED
#include <boost/asio.hpp>
#include <boost/format.hpp>
#include <boost/iostreams/stream.hpp>

// Headers only json.
#define BOOST_JSON_NO_LIB
#include <boost/json.hpp>
#include <boost/locale.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/program_options.hpp>
#include <boost/url.hpp>
Expand Down
Loading