aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff')
-rw-r--r--vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff49
1 files changed, 49 insertions, 0 deletions
diff --git a/vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff b/vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff
new file mode 100644
index 0000000..c0912c9
--- /dev/null
+++ b/vcpkg/ports/boost-mpi/revert_mpi_cxx_bool.diff
@@ -0,0 +1,49 @@
+diff --git a/include/boost/mpi/datatype.hpp b/include/boost/mpi/datatype.hpp
+index ef8aa2e..b9d4902 100644
+--- a/include/boost/mpi/datatype.hpp
++++ b/include/boost/mpi/datatype.hpp
+@@ -212,10 +212,6 @@ BOOST_MPI_DATATYPE(packed, MPI_PACKED, builtin);
+ /// INTERNAL ONLY
+ BOOST_MPI_DATATYPE(char, MPI_CHAR, builtin);
+
+-/// INTERNAL ONLY
+-/// We need to pick a boolean type, MPI_CXX_BOOL seems appropriate
+-BOOST_MPI_DATATYPE(bool, MPI_CXX_BOOL, logical);
+-
+ /// INTERNAL ONLY
+ BOOST_MPI_DATATYPE(short, MPI_SHORT, integer);
+
+@@ -321,6 +317,33 @@ BOOST_MPI_DATATYPE(signed char, MPI_SIGNED_CHAR, builtin);
+
+ #endif // Doxygen
+
++namespace detail {
++ inline MPI_Datatype build_mpi_datatype_for_bool()
++ {
++ // this is explicitly freed in mpi_datatype_map::clear
++ MPI_Datatype type;
++ MPI_Type_contiguous(sizeof(bool), MPI_BYTE, &type);
++ MPI_Type_commit(&type);
++ return type;
++ }
++}
++
++/// Support for bool. There is no corresponding MPI_BOOL.
++/// INTERNAL ONLY
++template<>
++inline MPI_Datatype get_mpi_datatype<bool>(const bool&)
++{
++ static MPI_Datatype type = detail::build_mpi_datatype_for_bool();
++ return type;
++}
++
++/// INTERNAL ONLY
++template<>
++struct is_mpi_datatype<bool>
++ : boost::mpl::bool_<true>
++{};
++
++
+ #ifndef BOOST_MPI_DOXYGEN
+ // direct support for special primitive data types of the serialization library
+ BOOST_MPI_DATATYPE(boost::serialization::library_version_type, get_mpi_datatype(uint_least16_t()), integer);