From d3daf6db42a5d04e86cc62a58f2751aeac9b0f91 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 24 Dec 2001 17:10:47 +0000 Subject: [PATCH] Renamed BOOST_MSVC_ONLY to BOOST_FUNCTION_TARGET_FIX Metrowerks needs the BOOST_FUNCTION_TARGET_FIX workaround [SVN r12144] --- include/boost/function.hpp | 10 +++++----- include/boost/function/function_base.hpp | 6 +++--- include/boost/function/function_template.hpp | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/boost/function.hpp b/include/boost/function.hpp index c43c176..78fc18d 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -456,12 +456,12 @@ namespace boost { function() : base_type() {} template - function(Functor BOOST_MSVC_ONLY(const &) f) : base_type(f) {} + function(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) : base_type(f) {} function(const self_type& f) : base_type(static_cast(f)){} template - self_type& operator=(Functor BOOST_MSVC_ONLY(const &) f) + self_type& operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) { self_type(f).swap(*this); return *this; @@ -476,11 +476,11 @@ namespace boost { self_type& operator=(const self_type& f) { self_type(f).swap(*this); - return *this; - } + return *this; + } template - void set(Functor BOOST_MSVC_ONLY(const &) f) + void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) { self_type(f).swap(*this); } diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 835f96c..6f88cc5 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -25,10 +25,10 @@ #include #include -#ifdef BOOST_MSVC -# define BOOST_MSVC_ONLY(x) x +#if defined(BOOST_MSVC) || defined(__MWERKS__) +# define BOOST_FUNCTION_TARGET_FIX(x) x #else -# define BOOST_MSVC_ONLY(x) +# define BOOST_FUNCTION_TARGET_FIX(x) #endif // not MSVC namespace boost { diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index db8e470..8c21f56 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -203,7 +203,7 @@ namespace boost { // MSVC chokes if the following two constructors are collapsed into // one with a default parameter. template - BOOST_FUNCTION_FUNCTION(Functor BOOST_MSVC_ONLY(const &) f) : + BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) : function_base(), Mixin(), invoker(0) { this->assign_to(f); @@ -244,14 +244,15 @@ namespace boost { // handle BOOST_FUNCTION_FUNCTION as the type of the temporary to // construct. template - BOOST_FUNCTION_FUNCTION& operator=(Functor f) + BOOST_FUNCTION_FUNCTION& + operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) { self_type(f, static_cast(*this)).swap(*this); return *this; } template - void set(Functor f) + void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) { self_type(f, static_cast(*this)).swap(*this); }