diff --git a/include/boost/smart_ptr/detail/atomic_count_gcc.hpp b/include/boost/smart_ptr/detail/atomic_count_gcc.hpp index df7e323..f8b5621 100644 --- a/include/boost/smart_ptr/detail/atomic_count_gcc.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_gcc.hpp @@ -23,6 +23,13 @@ # include #endif +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using libstdc++ atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp b/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp index 5c44d7c..100c9cf 100644 --- a/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp @@ -13,6 +13,13 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/x86 atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_nt.hpp b/include/boost/smart_ptr/detail/atomic_count_nt.hpp index 3bbf138..63b848f 100644 --- a/include/boost/smart_ptr/detail/atomic_count_nt.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_nt.hpp @@ -15,6 +15,13 @@ // http://www.boost.org/LICENSE_1_0.txt // +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using single-threaded, non-atomic atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_pt.hpp b/include/boost/smart_ptr/detail/atomic_count_pt.hpp index f99b910..69a494d 100644 --- a/include/boost/smart_ptr/detail/atomic_count_pt.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_pt.hpp @@ -14,6 +14,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using pthread_mutex atomic_count") + +#endif + // // The generic pthread_mutex-based implementation sometimes leads to // inefficiencies. Example: a class with two atomic_count members diff --git a/include/boost/smart_ptr/detail/atomic_count_solaris.hpp b/include/boost/smart_ptr/detail/atomic_count_solaris.hpp index a13bcfb..fb80d0a 100644 --- a/include/boost/smart_ptr/detail/atomic_count_solaris.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_solaris.hpp @@ -15,6 +15,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Solaris atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_spin.hpp b/include/boost/smart_ptr/detail/atomic_count_spin.hpp index 8e62349..66332e9 100644 --- a/include/boost/smart_ptr/detail/atomic_count_spin.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_spin.hpp @@ -13,6 +13,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using spinlock-based atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp b/include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp index 3d5fb78..360d26a 100644 --- a/include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp @@ -16,6 +16,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using std::atomic atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_sync.hpp b/include/boost/smart_ptr/detail/atomic_count_sync.hpp index b6359b5..81d7d65 100644 --- a/include/boost/smart_ptr/detail/atomic_count_sync.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_sync.hpp @@ -19,6 +19,13 @@ # include #endif +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using __sync atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_win32.hpp b/include/boost/smart_ptr/detail/atomic_count_win32.hpp index 633e73c..664d760 100644 --- a/include/boost/smart_ptr/detail/atomic_count_win32.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_win32.hpp @@ -19,6 +19,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Win32 atomic_count") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp b/include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp index 07c07e2..b31997d 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp @@ -19,6 +19,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using HP aCC++/HP-UX/IA64 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp b/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp index 072c667..65dc11f 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_aix.hpp @@ -25,6 +25,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using AIX sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp b/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp index 2c3938f..3a2ab0e 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp @@ -20,6 +20,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Clang/C11 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/include/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp index 8e5a414..f9df68a 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp @@ -27,6 +27,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp b/include/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp index 1ab21a5..297f055 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp @@ -28,6 +28,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using CodeWarrior/x86 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp b/include/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp index 73d4533..0c8d172 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp @@ -19,6 +19,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/IA64 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp b/include/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp index f109f65..5cc5de9 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp @@ -23,6 +23,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/MIPS sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp b/include/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp index 5dce1cf..c5f84f5 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp @@ -27,6 +27,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/PowerPC sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp b/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp index a3d7295..8062487 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp @@ -23,6 +23,13 @@ #include #include // int32_t +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/Sparc sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp b/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp index ebbea50..1c55918 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp @@ -27,6 +27,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/x86 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp b/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp index 0830050..eb37a79 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp @@ -23,6 +23,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using single-threaded, non-atomic sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp b/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp index ec850fe..b296e2d 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_pt.hpp @@ -24,6 +24,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using pthread_mutex sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp b/include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp index f38eee6..d60dd75 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp @@ -6,7 +6,7 @@ # pragma once #endif -// detail/sp_counted_base_gcc_sparc.hpp - g++ on Sparc V8+ +// detail/sp_counted_base_gcc_snc_ps3.hpp - PS3 Cell // // Copyright (c) 2006 Piotr Wyderski // Copyright (c) 2006 Tomas Puverle @@ -23,6 +23,13 @@ #include #include // uint32_t +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using PS3 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_solaris.hpp b/include/boost/smart_ptr/detail/sp_counted_base_solaris.hpp index 29f6b8a..4ad6b5e 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_solaris.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_solaris.hpp @@ -24,6 +24,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Solaris sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_spin.hpp b/include/boost/smart_ptr/detail/sp_counted_base_spin.hpp index 56911bd..4412cee 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_spin.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_spin.hpp @@ -22,6 +22,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using spinlock-based sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp b/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp index 338eeea..52acf92 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp @@ -21,6 +21,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using std::atomic sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp b/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp index 8446560..111410e 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp @@ -23,6 +23,13 @@ # include #endif +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using __sync sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp b/include/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp index 2467e95..e08536d 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp @@ -24,6 +24,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using xlC/PowerPC sp_counted_base") + +#endif + extern "builtin" void __lwsync(void); extern "builtin" void __isync(void); extern "builtin" int __fetch_and_add(volatile int* addr, int val); diff --git a/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp b/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp index 15853f9..dc0df4a 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp @@ -29,6 +29,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Win32 sp_counted_base") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp b/include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp index 24d08a8..e618f6e 100644 --- a/include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +++ b/include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp @@ -11,6 +11,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using g++/ARM spinlock") + +#endif + #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__) # define BOOST_SP_ARM_BARRIER "dmb" diff --git a/include/boost/smart_ptr/detail/spinlock_nt.hpp b/include/boost/smart_ptr/detail/spinlock_nt.hpp index 1f399d0..ce23761 100644 --- a/include/boost/smart_ptr/detail/spinlock_nt.hpp +++ b/include/boost/smart_ptr/detail/spinlock_nt.hpp @@ -17,6 +17,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using single-threaded spinlock emulation") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/spinlock_pt.hpp b/include/boost/smart_ptr/detail/spinlock_pt.hpp index f9cabfc..a7f8a81 100644 --- a/include/boost/smart_ptr/detail/spinlock_pt.hpp +++ b/include/boost/smart_ptr/detail/spinlock_pt.hpp @@ -17,6 +17,13 @@ #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using pthread_mutex spinlock emulation") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp b/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp index b1d1eea..458370c 100644 --- a/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp +++ b/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp @@ -19,6 +19,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using std::atomic spinlock") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/spinlock_sync.hpp b/include/boost/smart_ptr/detail/spinlock_sync.hpp index a7145c5..854cc7e 100644 --- a/include/boost/smart_ptr/detail/spinlock_sync.hpp +++ b/include/boost/smart_ptr/detail/spinlock_sync.hpp @@ -21,6 +21,13 @@ # include #endif +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using __sync spinlock") + +#endif + namespace boost { diff --git a/include/boost/smart_ptr/detail/spinlock_w32.hpp b/include/boost/smart_ptr/detail/spinlock_w32.hpp index d34e4fc..39092ce 100644 --- a/include/boost/smart_ptr/detail/spinlock_w32.hpp +++ b/include/boost/smart_ptr/detail/spinlock_w32.hpp @@ -18,6 +18,13 @@ #include #include +#if defined(BOOST_SP_REPORT_IMPLEMENTATION) + +#include +BOOST_PRAGMA_MESSAGE("Using Win32 spinlock") + +#endif + // BOOST_COMPILER_FENCE #if defined(__INTEL_COMPILER) diff --git a/test/Jamfile b/test/Jamfile index 1dde2c0..3619273 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -397,3 +397,4 @@ run shared_ptr_mt_test.cpp run weak_ptr_mt_test.cpp : : : multi ; +compile sp_report_implementation.cpp ; diff --git a/test/sp_report_implementation.cpp b/test/sp_report_implementation.cpp new file mode 100644 index 0000000..be0cccf --- /dev/null +++ b/test/sp_report_implementation.cpp @@ -0,0 +1,12 @@ +// Copyright 2020 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#define BOOST_SP_REPORT_IMPLEMENTATION +#include +#include +#include + +int main() +{ +}