From 4184211ef3d1957a395a461e4ca480a7928e83a8 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 2 Dec 2014 18:20:13 +0100 Subject: [PATCH] let's try to please windows --- include/simgrid/modelchecker.h | 2 +- src/mc/mc_base.c | 4 ++++ src/mc/mc_base.h | 2 +- src/mc/mc_global.c | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/simgrid/modelchecker.h b/include/simgrid/modelchecker.h index 6fe5c2c5a2..0d41344468 100644 --- a/include/simgrid/modelchecker.h +++ b/include/simgrid/modelchecker.h @@ -52,7 +52,7 @@ XBT_PUBLIC(void) MC_ignore(void *addr, size_t size); * * This is a path as generated by `MC_record_stack_to_string()`. */ -extern char* MC_record_path; +XBT_PUBLIC_DATA(char*) MC_record_path; /** Whether the replay mode is enabled */ static inline bool MC_record_replay_is_active(void) { diff --git a/src/mc/mc_base.c b/src/mc/mc_base.c index bd43d7a1ae..82ca8c6a4f 100644 --- a/src/mc/mc_base.c +++ b/src/mc/mc_base.c @@ -101,7 +101,11 @@ static int prng_random(int min, int max) // Use rejection in order to avoid skew long x; do { +#ifndef _XBT_WIN32 x = random(); +#else + x = rand(); +#endif } while( x >= accept_size ); return min + (x % output_size); } diff --git a/src/mc/mc_base.h b/src/mc/mc_base.h index 34852e4238..c46241459f 100644 --- a/src/mc/mc_base.h +++ b/src/mc/mc_base.h @@ -9,7 +9,7 @@ #include #include "simgrid_config.h" - +#include "internal_config.h" #include "../simix/smx_private.h" SG_BEGIN_DECL() diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index ec5e3c301e..d2a2e5ef78 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -4,6 +4,8 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ + +#ifndef _XBT_WIN32 #include #include #include @@ -13,6 +15,7 @@ #define UNW_LOCAL_ONLY #include +#endif #include "simgrid/sg_config.h" #include "../surf/surf_private.h" -- 2.20.1