Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60210 - in trunk: boost boost/random/detail libs/random/src
From: steven_at_[hidden]
Date: 2010-03-05 14:56:53


Author: steven_watanabe
Date: 2010-03-05 14:56:52 EST (Fri, 05 Mar 2010)
New Revision: 60210
URL: http://svn.boost.org/trac/boost/changeset/60210

Log:
Fix dll linking
Text files modified:
   trunk/boost/nondet_random.hpp | 10 +++++-----
   trunk/boost/random/detail/auto_link.hpp | 2 +-
   trunk/libs/random/src/random_device.cpp | 12 +++++++-----
   3 files changed, 13 insertions(+), 11 deletions(-)

Modified: trunk/boost/nondet_random.hpp
==============================================================================
--- trunk/boost/nondet_random.hpp (original)
+++ trunk/boost/nondet_random.hpp 2010-03-05 14:56:52 EST (Fri, 05 Mar 2010)
@@ -104,8 +104,8 @@
    * access specification (for example, a URL) to some implementation-defined
    * service for monitoring a stochastic process.
    */
- explicit random_device(const std::string& token = default_token);
- ~random_device();
+ BOOST_RANDOM_DECL explicit random_device(const std::string& token = default_token);
+ BOOST_RANDOM_DECL ~random_device();
   /**
    * Returns: An entropy estimate for the random numbers returned by
    * operator(), in the range min() to log2( max()+1). A deterministic
@@ -114,14 +114,14 @@
    *
    * Throws: Nothing.
    */
- double entropy() const;
+ BOOST_RANDOM_DECL double entropy() const;
   /**
    * Returns: A random value in the range [min, max]
    */
- unsigned int operator()();
+ BOOST_RANDOM_DECL unsigned int operator()();
 
 private:
- static const char * const default_token;
+ BOOST_RANDOM_DECL static const char * const default_token;
 
   /*
    * std:5.3.5/5 [expr.delete]: "If the object being deleted has incomplete

Modified: trunk/boost/random/detail/auto_link.hpp
==============================================================================
--- trunk/boost/random/detail/auto_link.hpp (original)
+++ trunk/boost/random/detail/auto_link.hpp 2010-03-05 14:56:52 EST (Fri, 05 Mar 2010)
@@ -14,7 +14,7 @@
 #include <boost/config.hpp>
 
 #ifdef BOOST_HAS_DECLSPEC
- #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
+ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_RANDOM_DYN_LINK)
         #if defined(BOOST_RANDOM_SOURCE)
             #define BOOST_RANDOM_DECL __declspec(dllexport)
         #else

Modified: trunk/libs/random/src/random_device.cpp
==============================================================================
--- trunk/libs/random/src/random_device.cpp (original)
+++ trunk/libs/random/src/random_device.cpp 2010-03-05 14:56:52 EST (Fri, 05 Mar 2010)
@@ -31,7 +31,9 @@
 #include <wincrypt.h>
 #include <stdexcept> // std::invalid_argument
 
-const char * const boost::random_device::default_token = MS_DEF_PROV_A;
+#pragma comment(lib, "Advapi32.lib")
+
+BOOST_RANDOM_DECL const char * const boost::random_device::default_token = MS_DEF_PROV_A;
 
 class boost::random_device::impl
 {
@@ -164,25 +166,25 @@
 
 #endif // BOOST_WINDOWS
 
-boost::random_device::random_device(const std::string& token)
+BOOST_RANDOM_DECL boost::random_device::random_device(const std::string& token)
   : pimpl(new impl(token))
 {
   assert((std::numeric_limits<result_type>::max)() == max_value);
 }
 
-boost::random_device::~random_device()
+BOOST_RANDOM_DECL boost::random_device::~random_device()
 {
   // the complete class impl is now visible, so we're safe
   // (see comment in random.hpp)
   delete pimpl;
 }
 
-double boost::random_device::entropy() const
+BOOST_RANDOM_DECL double boost::random_device::entropy() const
 {
   return 10;
 }
 
-unsigned int boost::random_device::operator()()
+BOOST_RANDOM_DECL unsigned int boost::random_device::operator()()
 {
   return pimpl->next();
 }


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