Branch oldpackages for 14.07
[14.07/packages.git] / libs / wt / patches / 100-fix_random_dev.patch
1 --- a/src/web/random_device.cpp
2 +++ b/src/web/random_device.cpp
3 @@ -39,16 +39,6 @@
4  #endif
5  
6  #ifdef USE_URANDOM
7 -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
8 -//  A definition is required even for integral static constants
9 -const bool boost::random_device::has_fixed_range;
10 -const boost::random_device::result_type boost::random_device::min_value;
11 -const boost::random_device::result_type boost::random_device::max_value;
12 -#endif
13 -
14 -// the default is the unlimited capacity device, using some secure hash
15 -// try "/dev/random" for blocking when the entropy pool has drained
16 -const char * const boost::random_device::default_token = "/dev/urandom";
17  
18  /*
19   * This uses the POSIX interface for unbuffered reading.
20 @@ -119,7 +109,6 @@
21  #include <windows.h>
22  #include <wincrypt.h>
23  #include <stdexcept>
24 -const char * const boost::random_device::default_token = "";
25  
26  // Note about thread-safety: according to my reading of the MSDN page 
27  // 'Threading Issues with Cryptographic Service Providers', both the
28 @@ -156,6 +145,10 @@
29  };
30  #endif
31  
32 +BOOST_RANDOM_DECL boost::random::random_device::random_device()
33 +  : pimpl(new impl("/dev/urandom"))
34 +{}
35 +
36  boost::random_device::random_device(const std::string& token)
37    : pimpl(new impl(token))
38  {