Commit fc0391dd authored by Nicolas Van der Noot's avatar Nicolas Van der Noot
Browse files

correct win 32 errors

parent 01b79733
......@@ -562,10 +562,10 @@ Simu_realtime* init_simu_realtime(MbsData* mbs_data, Realtime_option *options, i
// memory allocation: each constraint (one by one)
for (i=0; i<nb_constraints; i++)
{
#ifdef WIN32
constraints[i] = init_realtime_constraint((int) (1e6 / fqc_tab[i]), cur_t_usec, tsim);
#else
#ifdef UNIX
constraints[i] = init_realtime_constraint((int) round(1e6 / fqc_tab[i]), cur_t_usec, tsim);
#else
constraints[i] = init_realtime_constraint((int) (1e6 / fqc_tab[i]), cur_t_usec, tsim);
#endif
}
}
......
......@@ -32,7 +32,7 @@ int t_usec(int init_t_sec, int init_t_usec)
}
/// get current time fot Windows
#ifdef WIN32
#ifndef UNIX
int gettimeofday (struct timeval *tp, void *tz)
{
struct _timeb timebuffer;
......
......@@ -13,26 +13,21 @@
#ifdef UNIX
#include <sys/time.h>
#endif
#ifdef WIN32
#else
#include <time.h>
#include <sys/timeb.h>
typedef struct timeval {
long tv_sec;
long tv_usec;
} timeval;
#endif
// prototypes
void time_get(int *t_sec, int *t_usec);
int t_usec(int init_t_sec, int init_t_usec);
#ifdef WIN32
#ifndef UNIX
int gettimeofday (struct timeval *tp, void *tz);
#endif
......
......@@ -2016,10 +2016,10 @@ void plot_screen_sdl(Simu_realtime *realtime, double tsim, int screen_flag)
// height corresponding to 0
alpha_nul_axis = y_max_sdl / diff_y_sdl;
#ifdef WIN32
y_pixel_nul_axis = (alpha_nul_axis * screen_sdl->plot_y_end + (1-alpha_nul_axis) * PLOT_Y_START);
#else
#ifdef UNIX
y_pixel_nul_axis = round(alpha_nul_axis * screen_sdl->plot_y_end + (1-alpha_nul_axis) * PLOT_Y_START);
#else
y_pixel_nul_axis = (alpha_nul_axis * screen_sdl->plot_y_end + (1-alpha_nul_axis) * PLOT_Y_START);
#endif
......
......@@ -34,7 +34,7 @@ Write_files* init_write_files(int nstep, int njoint)
*/
void free_write_files(Write_files *write_files, int njoint)
{
#ifndef WIN32 // strange bug with Windows -> to investigate
#ifdef UNIX // strange bug with Windows -> to investigate
free_double_vec(write_files->t);
free_double_tab(write_files->qq, njoint);
free_double_tab(write_files->out_vec, NB_OUTPUT_VEC);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment