Skip to content

Commit

Permalink
Fix for issue 675 (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland authored Aug 23, 2021
1 parent 5649677 commit 720536a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
22 changes: 16 additions & 6 deletions include/boost/math/tools/header_deprecated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@
#ifndef BOOST_MATH_TOOLS_HEADER_DEPRECATED
#define BOOST_MATH_TOOLS_HEADER_DEPRECATED

#ifdef _MSC_VER
// Expands to "This header is deprecated; use expr instead."
#define BOOST_MATH_HEADER_DEPRECATED(expr) __pragma("This header is deprecated; use " expr " instead.")
#else // GNU, Clang, Intel, IBM, etc.
#ifndef BOOST_MATH_STANDALONE

# include <boost/config/header_deprecated.hpp>
# define BOOST_MATH_HEADER_DEPRECATED(expr) BOOST_HEADER_DEPRECATED(expr)

#else

# ifdef _MSC_VER
// Expands to "This header is deprecated; use expr instead."
#define BOOST_MATH_HEADER_DEPRECATED(expr) _Pragma("This header is deprecated; use " expr " instead.")
#endif
# define BOOST_MATH_HEADER_DEPRECATED(expr) __pragma("This header is deprecated; use " expr " instead.")
# else // GNU, Clang, Intel, IBM, etc.
// Expands to "This header is deprecated use expr instead"
# define BOOST_MATH_HEADER_DEPRECATED_MESSAGE(expr) _Pragma(#expr)
# define BOOST_MATH_HEADER_DEPRECATED(expr) BOOST_MATH_HEADER_DEPRECATED_MESSAGE(message "This header is deprecated use " expr " instead")
# endif

#endif // BOOST_MATH_STANDALONE

#endif // BOOST_MATH_TOOLS_HEADER_DEPRECATED
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ test-suite mp :
;

test-suite misc :
[ run header_deprecated_test.cpp ]
[ run threading_sanity_check.cpp ]
[ run test_tr1.cpp
../build//boost_math_tr1
Expand Down
12 changes: 12 additions & 0 deletions test/header_deprecated_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// (C) Copyright Matt Borland 2021.
// Use, modification and distribution are subject to 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)

#include <boost/math/tools/header_deprecated.hpp>

int main()
{
BOOST_MATH_HEADER_DEPRECATED("<boost/integer/common_factor_rt.hpp>");
return 0;
}

0 comments on commit 720536a

Please sign in to comment.