2
0
mirror of https://github.com/boostorg/random.git synced 2026-01-19 04:22:17 +00:00

Fix dll linking

[SVN r60210]
This commit is contained in:
Steven Watanabe
2010-03-05 19:56:52 +00:00
parent 115e454ea7
commit bef66181dd
3 changed files with 13 additions and 11 deletions

View File

@@ -104,8 +104,8 @@ public:
* 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 @@ public:
*
* 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

View File

@@ -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

View File

@@ -31,7 +31,9 @@ const boost::random_device::result_type boost::random_device::max_value;
#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 @@ private:
#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();
}