aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_eventcount.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-17 19:29:27 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-17 19:29:27 -0700
commit84543c8be2076b747bbc730a760e7693ab6caae4 (patch)
tree2c8d91ea2c366ef304dc92b3c641fd58bb1185fa /unsupported/test/cxx11_eventcount.cpp
parent5fbcfe5eb45a946230c06b7a7cac2e6ec6088457 (diff)
Worked around the lack of a rand_r function on windows systems
Diffstat (limited to 'unsupported/test/cxx11_eventcount.cpp')
-rw-r--r--unsupported/test/cxx11_eventcount.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_eventcount.cpp b/unsupported/test/cxx11_eventcount.cpp
index ebd019e2d..59039dae9 100644
--- a/unsupported/test/cxx11_eventcount.cpp
+++ b/unsupported/test/cxx11_eventcount.cpp
@@ -12,6 +12,14 @@
#include "main.h"
#include <Eigen/CXX11/ThreadPool>
+#ifdef EIGEN_COMP_MSVC_STRICT
+// Visual studio doesn't implementan rand_r() function since its
+// implementation of rand()is already thread safe
+int rand_r(unsigned int*) {
+ return rand();
+}
+#endif
+
static void test_basic_eventcount()
{
std::vector<EventCount::Waiter> waiters(1);