Boost logo

Boost-Commit :

From: oryol_at_[hidden]
Date: 2008-04-18 13:46:00


Author: jeremypack
Date: 2008-04-18 13:45:59 EDT (Fri, 18 Apr 2008)
New Revision: 44549
URL: http://svn.boost.org/trac/boost/changeset/44549

Log:
Changes to shared_library.hpp to attempt to successfully compile on MSVC.

Added:
   sandbox/boost/extension/impl/shared_library.hpp (contents, props changed)
Text files modified:
   sandbox/boost/extension/shared_library.hpp | 19 ++++++-------------
   1 files changed, 6 insertions(+), 13 deletions(-)

Added: sandbox/boost/extension/impl/shared_library.hpp
==============================================================================
--- (empty file)
+++ sandbox/boost/extension/impl/shared_library.hpp 2008-04-18 13:45:59 EDT (Fri, 18 Apr 2008)
@@ -0,0 +1,19 @@
+/*
+ * Boost.Extension / implementation header for Boost.PreProcessor
+ *
+ * (C) Copyright Jeremy Pack 2007
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * See http://www.boost.org/ for latest version.
+ */
+# define N BOOST_PP_ITERATION()
+// No ifndef headers - this is meant to be included multiple times.
+template <class ReturnValue BOOST_PP_COMMA_IF(N)
+ BOOST_PP_ENUM_PARAMS(N, class Param) >
+ReturnValue (*get(const std::string& name))(BOOST_PP_ENUM_PARAMS(N, Param)) {
+ return reinterpret_cast<ReturnValue (*)(BOOST_PP_ENUM_PARAMS(N, Param))>
+ (get_function(handle_, name.c_str()));
+}
+#undef N
\ No newline at end of file

Modified: sandbox/boost/extension/shared_library.hpp
==============================================================================
--- sandbox/boost/extension/shared_library.hpp (original)
+++ sandbox/boost/extension/shared_library.hpp 2008-04-18 13:45:59 EDT (Fri, 18 Apr 2008)
@@ -15,16 +15,9 @@
 #include <string>
 #include <boost/extension/impl/library_impl.hpp>
 #include <boost/extension/common.hpp>
-namespace boost { namespace extensions {
-
-#define BOOST_EXTENSION_SHARED_LIBRARY_GET_FUNCTION(Z, N, _) \
-template <class ReturnValue BOOST_PP_COMMA_IF(N) \
- BOOST_PP_ENUM_PARAMS(N, class Param) > \
-ReturnValue (*get(const std::string& name))(BOOST_PP_ENUM_PARAMS(N, Param)) { \
- return reinterpret_cast<ReturnValue (*)(BOOST_PP_ENUM_PARAMS(N, Param))> \
- (get_function(handle_, name.c_str())); \
-}
+#include <boost/preprocessor/iteration/iterate.hpp>
 
+namespace boost { namespace extensions {
 
 class shared_library
 {
@@ -39,10 +32,10 @@
   shared_library(const std::string& location, bool auto_close = false)
   :location_(location), handle_(0), auto_close_(auto_close) {
   }
-
-BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_EXTENSION_MAX_FUNCTOR_PARAMS), \
- BOOST_EXTENSION_SHARED_LIBRARY_GET_FUNCTION, _)
-
+#define BOOST_PP_ITERATION_LIMITS (0, \
+ BOOST_PP_INC(BOOST_REFLECTION_MAX_FUNCTOR_PARAMS) - 1)
+#define BOOST_PP_FILENAME_1 <boost/extension/impl/shared_library.hpp>
+#include BOOST_PP_ITERATE()
 protected:
   std::string location_;
   library_handle handle_;


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