Re-order include and try typedef

pull/12/head
Izaak Beekman 8 years ago
parent ac5721677d
commit bb45b4092d
No known key found for this signature in database
GPG Key ID: A93CE70D8021BD0F

@ -410,7 +410,7 @@ if (SERIAL_MPI)
list(APPEND PSB_base_source_C_files modules/fakempi.c) list(APPEND PSB_base_source_C_files modules/fakempi.c)
endif() endif()
if(WIN32) 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() endif()
foreach(file IN LISTS PSB_base_source_C_files) foreach(file IN LISTS PSB_base_source_C_files)
list(APPEND base_source_C_files ${CMAKE_CURRENT_LIST_DIR}/${file}) list(APPEND base_source_C_files ${CMAKE_CURRENT_LIST_DIR}/${file})

@ -1,6 +1,6 @@
#ifdef _WIN32 #ifdef _WIN32
#include <time.h>
#include <windows.h> #include <windows.h>
#include <time.h>
#else #else
#include <sys/time.h> #include <sys/time.h>
#endif #endif

@ -1,12 +1,12 @@
#include <stdio.h>
#include <string.h>
#ifdef _WIN32 #ifdef _WIN32
#include <time.h>
#include <windows.h> #include <windows.h>
#include <time.h>
#include "gettimeofday.h" #include "gettimeofday.h"
#else #else
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <stdio.h>
#include <string.h>
#include "psb_internals.h" #include "psb_internals.h"
@ -108,7 +108,7 @@
#define mpi_complex 5 #define mpi_complex 5
#define mpi_double_complex 6 #define mpi_double_complex 6
double mpi_wtime() double mpi_wtime()
{ {
struct timeval tt; struct timeval tt;
struct timezone tz; struct timezone tz;

@ -6,11 +6,11 @@
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif #endif
struct timezone typedef struct
{ {
int tz_minuteswest; /* minutes W of Greenwich */ int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */ int tz_dsttime; /* type of dst correction */
}; } timezone;
int gettimeofday(struct timeval *tv, struct timezone *tz) int gettimeofday(struct timeval *tv, struct timezone *tz)
{ {

@ -1,15 +1,15 @@
#include <time.h>
#include <windows.h> #include <windows.h>
#include <time.h>
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else #else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif #endif
struct timezone typedef struct
{ {
int tz_minuteswest; /* minutes W of Greenwich */ int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */ int tz_dsttime; /* type of dst correction */
}; } timezone;
int gettimeofday(struct timeval *tv, struct timezone *tz); int gettimeofday(struct timeval *tv, struct timezone *tz);

Loading…
Cancel
Save