Boost logo

Boost-Commit :

From: oryol_at_[hidden]
Date: 2008-03-17 17:24:45


Author: jeremypack
Date: 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
New Revision: 43683
URL: http://svn.boost.org/trac/boost/changeset/43683

Log:
Various fixes for Windows
Text files modified:
   sandbox/boost/extension/impl/typeinfo.hpp | 9 ++++-----
   sandbox/libs/extension/benchmarks/multiple_libraries.cpp | 27 ++++++++++++++-------------
   sandbox/libs/extension/examples/multiple_inheritance/car_of_the_future.cpp | 1 +
   sandbox/libs/extension/examples/multiple_inheritance/computer.hpp | 1 +
   sandbox/libs/extension/examples/multiple_inheritance/flying_car.cpp | 1 +
   sandbox/libs/extension/examples/multiple_inheritance/vehicle.hpp | 2 ++
   6 files changed, 23 insertions(+), 18 deletions(-)

Modified: sandbox/boost/extension/impl/typeinfo.hpp
==============================================================================
--- sandbox/boost/extension/impl/typeinfo.hpp (original)
+++ sandbox/boost/extension/impl/typeinfo.hpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -39,8 +39,7 @@
 
 // This list should be expanded to all platforms that successfully
 // compare type_info across shared library boundaries.
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || \
-defined(__APPLE__) || defined(BOOST_EXTENSION_FORCE_FAST_TYPEINFO)
+#if defined(__APPLE__) || defined(BOOST_EXTENSION_FORCE_FAST_TYPEINFO)
 namespace boost { namespace extensions {
 bool operator<(const default_type_info& first,
                const default_type_info& second) {
@@ -62,17 +61,17 @@
 namespace boost { namespace extensions {
 bool operator<(const default_type_info& first,
                const default_type_info& second) {
- return first.type.name() < second.type.name();
+ return std::strcmp(first.type.raw_name(), second.type.raw_name()) < 0;
 }
 
 bool operator==(const default_type_info& first,
                const default_type_info& second) {
- return first.type.name() == second.type.name();
+ return std::strcmp(first.type.raw_name(), second.type.raw_name()) == 0;
 }
 
 bool operator>(const default_type_info& first,
                const default_type_info& second) {
- return first.type.name() > second.type.name();
+ return std::strcmp(first.type.raw_name(), second.type.raw_name()) > 0;
 }
 }}
 #endif

Modified: sandbox/libs/extension/benchmarks/multiple_libraries.cpp
==============================================================================
--- sandbox/libs/extension/benchmarks/multiple_libraries.cpp (original)
+++ sandbox/libs/extension/benchmarks/multiple_libraries.cpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -94,22 +94,23 @@
     l.open();
     {
       factory_map fm;
- functor<void, factory_map &> load_func =
- l.get_functor<void, factory_map &>("extension_export_word");
+ void (*load_func)(factory_map &) =
+ l.get<void, factory_map &>("extension_export_word");
 
       load_func(fm);
 
- std::list<factory<word, int> > & factory_list = fm.get<word, int>();
- for (std::list<factory<word, int> >::iterator current_word =
- factory_list.begin(); current_word != factory_list.end();
- ++current_word) {
-
- std::auto_ptr<word> word_ptr(current_word->create());
-
- // do something with the word
- std::string s(word_ptr->get_val());
- s += "\n";
- }
+ std::map<int, factory<word> > & factory_list = fm.get<word, int>();
+ for (std::map<int, factory<word> >::iterator current_word =
+ factory_list.begin(); current_word != factory_list.end();
+ ++current_word)
+ {
+ // Using auto_ptr to avoid needing delete. Using smart_ptrs is
+ // recommended.
+ // Note that this has a zero argument constructor - currently constructors
+ // with up to six arguments can be used.
+ std::auto_ptr<word> word_ptr(current_word->second.create());
+ std::string cheese = word_ptr->get_val();
+ }
     }
     l.close();
   }

Modified: sandbox/libs/extension/examples/multiple_inheritance/car_of_the_future.cpp
==============================================================================
--- sandbox/libs/extension/examples/multiple_inheritance/car_of_the_future.cpp (original)
+++ sandbox/libs/extension/examples/multiple_inheritance/car_of_the_future.cpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -24,6 +24,7 @@
 
 #include "car_of_the_future.hpp"
 #include <boost/extension/factory_map.hpp>
+#include <string>
 
 std::string car_of_the_future::list_capabilities()
 {

Modified: sandbox/libs/extension/examples/multiple_inheritance/computer.hpp
==============================================================================
--- sandbox/libs/extension/examples/multiple_inheritance/computer.hpp (original)
+++ sandbox/libs/extension/examples/multiple_inheritance/computer.hpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -13,6 +13,7 @@
 #define BOOST_EXTENSION_COMPUTER_HPP
 #include <boost/extension/extension.hpp>
 #include <iostream>
+#include <string>
 #include <typeinfo>
 class BOOST_EXTENSION_COMPUTER_DECL computer
 {

Modified: sandbox/libs/extension/examples/multiple_inheritance/flying_car.cpp
==============================================================================
--- sandbox/libs/extension/examples/multiple_inheritance/flying_car.cpp (original)
+++ sandbox/libs/extension/examples/multiple_inheritance/flying_car.cpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -20,6 +20,7 @@
 - see the FAQ.
   */
 #include <boost/extension/extension.hpp>
+#include <string>
 #define BOOST_EXTENSION_FLYING_CAR_DECL BOOST_EXTENSION_EXPORT_DECL
 
 

Modified: sandbox/libs/extension/examples/multiple_inheritance/vehicle.hpp
==============================================================================
--- sandbox/libs/extension/examples/multiple_inheritance/vehicle.hpp (original)
+++ sandbox/libs/extension/examples/multiple_inheritance/vehicle.hpp 2008-03-17 17:24:44 EDT (Mon, 17 Mar 2008)
@@ -14,6 +14,8 @@
 #include <boost/extension/extension.hpp>
 #include <iostream>
 #include <typeinfo>
+#include <string>
+
 class BOOST_EXTENSION_VEHICLE_DECL vehicle
 {
 public:


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