Re: [MacPorts] #32558: mkvtoolnix: error: ‘boost::BOOST_FOREACH’ has not been declared

MacPorts noreply at macports.org
Tue Dec 27 10:16:11 PST 2011


#32558: mkvtoolnix: error: ‘boost::BOOST_FOREACH’ has not been declared
----------------------------------+-----------------------------------------
  Reporter:  palmer100@…          |       Owner:  kona8lend@…        
      Type:  defect               |      Status:  reopened           
  Priority:  Normal               |   Milestone:                     
 Component:  ports                |     Version:  2.0.3              
Resolution:                       |    Keywords:                     
      Port:  mkvtoolnix           |  
----------------------------------+-----------------------------------------
Changes (by akim.demaille@…):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 Because of that fix, it is no longer possible to have a workaround common
 to all the Boost versions!  It was trivial to fix 1.48 by define the macro
 *before* including the header:

 {{{

 /// \def foreach
 /// \brief A shortcut for \a BOOST_FOREACH.
 ///
 /// Not to be confused with libport::for_each.

 // No redefinition if already defined by other libraries.
 //
 // It would seem saner to declare this macro *after* having included
 // the definition of BOOST_FOREACH, but BOOST_FOREACH is actually
 // buggy, and uses the identifier "foreach" as a namespace on
 // occasion.  And unfortunately, this shows (see
 // http://thread.gmane.org/gmane.comp.lib.boost.user/71410, and
 // https://svn.boost.org/trac/boost/ticket/6131).
 //
 // Luckily, Boost.Foreach is header-only, so one way out is to
 // make sure we use BOOST_FOREACH consistently *everywhere*, so define
 // foreach before including the header.
 //
 // And never use boost/foreach.hpp, only libport/foreach.hh.
 #ifndef foreach
 # define foreach BOOST_FOREACH
 #endif

 /// \def rforeach
 /// \brief Shortcut for \a BOOST_REVERSE_FOREACH
 # define rforeach BOOST_REVERSE_FOREACH

 # include <libport/system-warning-push.hh>
 #  include <boost/foreach.hpp>
 # include <libport/system-warning-pop.hh>
 }}}

 Now this simple fix which was common to all the architectures will not
 work on MacPorts!  How the heck am I supposed to have code that works
 properly via CPP now???

 Fixing a library such as Boost seems wrong to me, too much entropy pushed
 on the users.

-- 
Ticket URL: <https://trac.macports.org/ticket/32558#comment:13>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list