From 836a8c67703dc5b431891e565f253c53d9f56bcf Mon Sep 17 00:00:00 2001 From: Vassil Keremidchiev Date: Thu, 10 Sep 2015 23:14:50 +0300 Subject: #125 Fixed pragma warning --- packages/base/src/Internal/C/vector-aux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/base/src') diff --git a/packages/base/src/Internal/C/vector-aux.c b/packages/base/src/Internal/C/vector-aux.c index 0b6b8b6..9dbf536 100644 --- a/packages/base/src/Internal/C/vector-aux.c +++ b/packages/base/src/Internal/C/vector-aux.c @@ -932,14 +932,19 @@ int vectorScan(char * file, int* n, double**pp){ //////////////////////////////////////////////////////////////////////////////// -#if defined (__APPLE__) || (__FreeBSD__) || defined(_WIN32) || defined(WIN32) +#if defined (__APPLE__) || (__FreeBSD__) /* FreeBSD and Mac OS X do not provide random_r(), thread safety cannot be guaranteed. For FreeBSD and Mac OS X, nrand48() is much better than random(). See: http://www.evanjones.ca/random-thread-safe.html */ #pragma message "randomVector is not thread-safe in OSX and FreeBSD" +#endif +#if defined (__APPLE__) || (__FreeBSD__) || defined(_WIN32) || defined(WIN32) +/* Windows use thread-safe random + See: http://stackoverflow.com/questions/143108/is-windows-rand-s-thread-safe +*/ inline double urandom() { /* the probalility of matching will be theoretically p^3(in fact, it is not) p is matching probalility of random(). -- cgit v1.2.3