Skip to content
Snippets Groups Projects
Commit b824e07f authored by Bertrand Bellenot's avatar Bertrand Bellenot Committed by Guilherme Amadio
Browse files

Fix compilation errors on Windows

- Add a couple of missing #include <algorithm>
- Replace _N by _NN (_N is already defined and used in some system math headers on Windows)
- Add #define __thread __declspec(thread)
parent 5c749a68
No related branches found
No related tags found
No related merge requests found
......@@ -490,7 +490,6 @@ struct Limits {
#if defined(R__WIN32) && !defined(__CINT__)
# ifndef finite
# define finite _finite
# define isnan _isnan
# endif
#endif
#if defined(R__AIX) || defined(R__SOLARIS_CC50) || \
......
......@@ -14,6 +14,7 @@
#include "Math/IFunction.h"
#include "Math/IFunctionfwd.h"
#include <cmath>
#include <algorithm>
namespace ROOT {
namespace Math {
......
......@@ -8,16 +8,20 @@
#define ROOT_Math_MixMaxEngineImpl
#if (_N==17)
#if (_NN==17)
namespace mixmax_17 {
#elif (_N==240)
#elif (_NN==240)
namespace mixmax_240 {
#elif (_N==256)
#elif (_NN==256)
namespace mixmax_256 {
#else
namespace {
#endif
#ifdef WIN32
#define __thread __declspec(thread)
#endif
#include "mixmax.icc"
#undef N
......@@ -27,11 +31,11 @@ namespace {
#include <iostream>
#if (_N==17)
#if (_NN==17)
using namespace mixmax_17;
#elif (_N==240)
#elif (_NN==240)
using namespace mixmax_240;
#elif (_N==256)
#elif (_NN==256)
using namespace mixmax_256;
#endif
......@@ -61,12 +65,12 @@ namespace ROOT {
template<>
class MixMaxEngineImpl<_N> {
class MixMaxEngineImpl<_NN> {
rng_state_t * fRngState;
public:
typedef MixMaxEngine<_N,0>::StateInt_t StateInt_t;
typedef MixMaxEngine<_N,0>::Result_t Result_t;
typedef MixMaxEngine<_NN,0>::StateInt_t StateInt_t;
typedef MixMaxEngine<_NN,0>::Result_t Result_t;
MixMaxEngineImpl(uint64_t seed) {
fRngState = rng_alloc();
......
// define number for used to Mixmax
#define _N 17
#define _NN 17
#include "MixMaxEngineImpl.h"
......
// define number for used to Mixmax
#define _N 240
#define _NN 240
#include "MixMaxEngineImpl.h"
......
// define number for used to Mixmax
#define _N 256
#define _NN 256
#include "MixMaxEngineImpl.h"
......
......@@ -12,6 +12,7 @@
#include "Math/IFunctionfwd.h"
#include <cmath>
#include <limits>
#include <algorithm>
#include "Math/Error.h"
......
......@@ -27,7 +27,7 @@
//extern "C" {
//#endif
#ifndef _N
#ifndef _NN
#define N 240
/* The currently recommended generator is the three-parameter MIXMAX with
N=240, s=487013230256099140, m=2^51+1
......@@ -38,7 +38,7 @@ N=240, s=487013230256099140, m=2^51+1
Since the algorithm is linear in N, the cost per number is almost independent of N.
*/
#else
#define N _N
#define N _NN
#endif
#ifndef __LP64__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment