lemon/random.h
changeset 1343 20f95cd51aba
parent 1338 0998f70d0b2d
parent 1340 f70f688d9ef9
child 1379 db1d342a1087
     1.1 --- a/lemon/random.h	Tue Apr 14 16:36:45 2015 +0200
     1.2 +++ b/lemon/random.h	Tue Apr 28 18:13:42 2015 +0200
     1.3 @@ -62,6 +62,8 @@
     1.4  #ifndef LEMON_RANDOM_H
     1.5  #define LEMON_RANDOM_H
     1.6  
     1.7 +#include <lemon/config.h>
     1.8 +
     1.9  #include <algorithm>
    1.10  #include <iterator>
    1.11  #include <vector>
    1.12 @@ -71,7 +73,7 @@
    1.13  #include <lemon/math.h>
    1.14  #include <lemon/dim2.h>
    1.15  
    1.16 -#ifndef WIN32
    1.17 +#ifndef LEMON_WIN32
    1.18  #include <sys/time.h>
    1.19  #include <ctime>
    1.20  #include <sys/types.h>
    1.21 @@ -605,7 +607,7 @@
    1.22      /// it uses the \c seedFromTime().
    1.23      /// \return Currently always \c true.
    1.24      bool seed() {
    1.25 -#ifndef WIN32
    1.26 +#ifndef LEMON_WIN32
    1.27        if (seedFromFile("/dev/urandom", 0)) return true;
    1.28  #endif
    1.29        if (seedFromTime()) return true;
    1.30 @@ -625,7 +627,7 @@
    1.31      /// \param file The source file
    1.32      /// \param offset The offset, from the file read.
    1.33      /// \return \c true when the seeding successes.
    1.34 -#ifndef WIN32
    1.35 +#ifndef LEMON_WIN32
    1.36      bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
    1.37  #else
    1.38      bool seedFromFile(const std::string& file = "", int offset = 0)
    1.39 @@ -647,7 +649,7 @@
    1.40      /// random sequence.
    1.41      /// \return Currently always \c true.
    1.42      bool seedFromTime() {
    1.43 -#ifndef WIN32
    1.44 +#ifndef LEMON_WIN32
    1.45        timeval tv;
    1.46        gettimeofday(&tv, 0);
    1.47        seed(getpid() + tv.tv_sec + tv.tv_usec);