← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2290: prefer boost's shared_ptr to the libstdc++ one on MinGW

 

------------------------------------------------------------
revno: 2290
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-11-12 18:22:02 +0100
message:
  prefer boost's shared_ptr to the libstdc++ one on MinGW
modified:
  dcpp/stdinc.h
  dwt/include/dwt/Cursor.h
  dwt/include/dwt/GCCHeaders.h
  dwt/include/dwt/forward.h
  dwt/include/dwt/resources/Font.h
  dwt/include/dwt/widgets/Menu.h
  win32/ShellMenu.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/stdinc.h'
--- dcpp/stdinc.h	2010-08-29 17:23:20 +0000
+++ dcpp/stdinc.h	2010-11-12 17:22:02 +0000
@@ -88,6 +88,18 @@
 #include <memory.h>
 #include <sys/types.h>
 
+#ifdef __MINGW32__
+/* the shared_ptr implementation provided by MinGW / GCC 4.5's libstdc++ consumes too many
+semaphores, so we prefer boost's one. see <https://bugs.launchpad.net/dcplusplus/+bug/654040>. */
+#define _SHARED_PTR_H 1 // skip libstdc++'s bits/shared_ptr.h
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/make_shared.hpp>
+using boost::shared_ptr;
+using boost::enable_shared_from_this;
+using boost::make_shared;
+#endif
+
 #include <algorithm>
 #include <vector>
 #include <string>

=== modified file 'dwt/include/dwt/Cursor.h'
--- dwt/include/dwt/Cursor.h	2010-07-10 14:36:48 +0000
+++ dwt/include/dwt/Cursor.h	2010-11-12 17:22:02 +0000
@@ -60,9 +60,9 @@
 		}
 	};
 
-	std::shared_ptr< Implementation > itsImplementation;
+	shared_ptr< Implementation > itsImplementation;
 
-	Cursor( std::shared_ptr< Implementation > implementation )
+	Cursor( shared_ptr< Implementation > implementation )
 		: itsImplementation( implementation )
 	{}
 
@@ -73,7 +73,7 @@
 	  */
 	static Cursor getWaitCursor()
 	{
-		std::shared_ptr< Implementation > implementation( new Implementation( ::SetCursor( ::LoadCursor( 0, IDC_WAIT ) ) ) );
+		shared_ptr< Implementation > implementation( new Implementation( ::SetCursor( ::LoadCursor( 0, IDC_WAIT ) ) ) );
 		return Cursor( implementation );
 	}
 };

=== modified file 'dwt/include/dwt/GCCHeaders.h'
--- dwt/include/dwt/GCCHeaders.h	2010-02-11 21:44:13 +0000
+++ dwt/include/dwt/GCCHeaders.h	2010-11-12 17:22:02 +0000
@@ -40,6 +40,18 @@
 #error This file is only for GCC
 #endif
 
+#ifdef __MINGW32__
+/* the shared_ptr implementation provided by MinGW / GCC 4.5's libstdc++ consumes too many
+semaphores, so we prefer boost's one. see <https://bugs.launchpad.net/dcplusplus/+bug/654040>. */
+#define _SHARED_PTR_H 1 // skip libstdc++'s bits/shared_ptr.h
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/make_shared.hpp>
+using boost::shared_ptr;
+using boost::enable_shared_from_this;
+using boost::make_shared;
+#endif
+
 // Need to forward declare these since GCC does syntax checking of
 // non-instantiated templates!
 BOOL CommandBar_InsertMenubarEx( HWND hwndCB, HINSTANCE hInst, LPTSTR pszMenu, WORD iButton );

=== modified file 'dwt/include/dwt/forward.h'
--- dwt/include/dwt/forward.h	2010-07-10 15:49:05 +0000
+++ dwt/include/dwt/forward.h	2010-11-12 17:22:02 +0000
@@ -67,7 +67,7 @@
 typedef Label* LabelPtr;
 
 class Menu;
-typedef std::shared_ptr<Menu> MenuPtr;
+typedef shared_ptr<Menu> MenuPtr;
 
 class MDIChild;
 typedef MDIChild* MDIChildPtr;
@@ -79,7 +79,7 @@
 typedef MDIParent* MDIParentPtr;
 
 class Notification;
-typedef std::shared_ptr<Notification> NotificationPtr;
+typedef shared_ptr<Notification> NotificationPtr;
 
 class ProgressBar;
 typedef ProgressBar* ProgressBarPtr;

=== modified file 'dwt/include/dwt/resources/Font.h'
--- dwt/include/dwt/resources/Font.h	2010-07-10 14:36:48 +0000
+++ dwt/include/dwt/resources/Font.h	2010-11-12 17:22:02 +0000
@@ -140,7 +140,7 @@
 //TODO: shouldn't this be within #ifndef WINCE ... #endif
 /// \ingroup GlobalStuff
 /// Creates a Font from a StockId value and returns a pointer to it.
-/** The returned object is of type std::shared_ptr< Font >, but you should use the
+/** The returned object is of type shared_ptr< Font >, but you should use the
   * typedef FontPtr and not <br>
   * the shared_ptr itself since this may change in future releases.
   */
@@ -148,7 +148,7 @@
 
 /// \ingroup GlobalStuff
 /// Creates a Font and returns a pointer to it.
-/** The returned object is of type std::shared_ptr< Font >, but you should use the
+/** The returned object is of type shared_ptr< Font >, but you should use the
   * typedef FontPtr and not <br>
   * the shared_ptr itself since this may change in future releases.
   */

=== modified file 'dwt/include/dwt/widgets/Menu.h'
--- dwt/include/dwt/widgets/Menu.h	2010-09-04 15:54:59 +0000
+++ dwt/include/dwt/widgets/Menu.h	2010-11-12 17:22:02 +0000
@@ -62,7 +62,7 @@
 	typedef Menu ThisType;
 
 	/// Object type
-	typedef std::shared_ptr<Menu> ObjectType;
+	typedef shared_ptr<Menu> ObjectType;
 
 	/// Global colors, can be changed through the seed
 	struct Colors {

=== modified file 'win32/ShellMenu.h'
--- win32/ShellMenu.h	2010-07-10 14:36:48 +0000
+++ win32/ShellMenu.h	2010-11-12 17:22:02 +0000
@@ -39,7 +39,7 @@
 public:
 	typedef ShellMenu ThisType;
 
-	typedef std::shared_ptr<ShellMenu> ObjectType;
+	typedef shared_ptr<ShellMenu> ObjectType;
 
 	struct Seed : public BaseType::Seed {
 		typedef ThisType WidgetType;