Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51686 - trunk/libs/smart_ptr/test
From: pdimov_at_[hidden]
Date: 2009-03-10 14:07:13


Author: pdimov
Date: 2009-03-10 14:07:13 EDT (Tue, 10 Mar 2009)
New Revision: 51686
URL: http://svn.boost.org/trac/boost/changeset/51686

Log:
Attempt to fix como link failure.
Text files modified:
   trunk/libs/smart_ptr/test/allocate_shared_test.cpp | 12 +++++++++---
   trunk/libs/smart_ptr/test/make_shared_test.cpp | 12 +++++++++---
   2 files changed, 18 insertions(+), 6 deletions(-)

Modified: trunk/libs/smart_ptr/test/allocate_shared_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/allocate_shared_test.cpp (original)
+++ trunk/libs/smart_ptr/test/allocate_shared_test.cpp 2009-03-10 14:07:13 EDT (Tue, 10 Mar 2009)
@@ -1,6 +1,6 @@
-// allocate_shared_test.cpp
+// allocate_shared_test.cpp
 //
-// Copyright (c) 2007, 2008 Peter Dimov
+// Copyright 2007-2009 Peter Dimov
 //
 // Distributed under the Boost Software License, Version 1.0.
 // See accompanying file LICENSE_1_0.txt or copy at
@@ -19,11 +19,17 @@
     X( X const & );
     X & operator=( X const & );
 
- void * operator new( std::size_t );
+ void * operator new( std::size_t n )
+ {
+ // lack of this definition causes link errors on Comeau C++
+ BOOST_ERROR( "private X::new called" );
+ return ::operator new( n );
+ }
 
     void operator delete( void * p )
     {
         // lack of this definition causes link errors on MSVC
+ BOOST_ERROR( "private X::delete called" );
         ::operator delete( p );
     }
 

Modified: trunk/libs/smart_ptr/test/make_shared_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/make_shared_test.cpp (original)
+++ trunk/libs/smart_ptr/test/make_shared_test.cpp 2009-03-10 14:07:13 EDT (Tue, 10 Mar 2009)
@@ -1,6 +1,6 @@
-// make_shared_test.cpp
+// make_shared_test.cpp
 //
-// Copyright (c) 2007, 2008 Peter Dimov
+// Copyright 2007-2009 Peter Dimov
 //
 // Distributed under the Boost Software License, Version 1.0.
 // See accompanying file LICENSE_1_0.txt or copy at
@@ -19,11 +19,17 @@
     X( X const & );
     X & operator=( X const & );
 
- void * operator new( std::size_t );
+ void * operator new( std::size_t n )
+ {
+ // lack of this definition causes link errors on Comeau C++
+ BOOST_ERROR( "private X::new called" );
+ return ::operator new( n );
+ }
 
     void operator delete( void * p )
     {
         // lack of this definition causes link errors on MSVC
+ BOOST_ERROR( "private X::delete called" );
         ::operator delete( p );
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk