diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index abe85e552..759c8a014 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -410,7 +410,7 @@ if (SERIAL_MPI) list(APPEND PSB_base_source_C_files modules/fakempi.c) endif() if(WIN32) - list(APPEND PSB_base_source_C_files modules/gettimeofday.c) + list(APPEND PSB_base_source_C_files modules/gettimeofday.c modules/gettimeofday.h) endif() foreach(file IN LISTS PSB_base_source_C_files) list(APPEND base_source_C_files ${CMAKE_CURRENT_LIST_DIR}/${file}) diff --git a/base/modules/cutil.c b/base/modules/cutil.c index 2eac4e1c9..a0f51d49e 100644 --- a/base/modules/cutil.c +++ b/base/modules/cutil.c @@ -1,6 +1,6 @@ #ifdef _WIN32 -#include #include +#include #else #include #endif diff --git a/base/modules/fakempi.c b/base/modules/fakempi.c index f0e8a5d1b..33c028609 100644 --- a/base/modules/fakempi.c +++ b/base/modules/fakempi.c @@ -1,12 +1,12 @@ -#include -#include #ifdef _WIN32 -#include #include +#include #include "gettimeofday.h" #else #include #endif +#include +#include #include "psb_internals.h" @@ -108,7 +108,7 @@ #define mpi_complex 5 #define mpi_double_complex 6 -double mpi_wtime() +double mpi_wtime() { struct timeval tt; struct timezone tz; diff --git a/base/modules/gettimeofday.c b/base/modules/gettimeofday.c index be0422717..f7a838616 100644 --- a/base/modules/gettimeofday.c +++ b/base/modules/gettimeofday.c @@ -6,11 +6,11 @@ #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif -struct timezone +typedef struct { int tz_minuteswest; /* minutes W of Greenwich */ int tz_dsttime; /* type of dst correction */ -}; +} timezone; int gettimeofday(struct timeval *tv, struct timezone *tz) { diff --git a/base/modules/gettimeofday.h b/base/modules/gettimeofday.h index 67673b2c4..7da9ed216 100644 --- a/base/modules/gettimeofday.h +++ b/base/modules/gettimeofday.h @@ -1,15 +1,15 @@ -#include #include +#include #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #else #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif -struct timezone +typedef struct { int tz_minuteswest; /* minutes W of Greenwich */ int tz_dsttime; /* type of dst correction */ -}; +} timezone; int gettimeofday(struct timeval *tv, struct timezone *tz);