I am trying to use postgresql together with SOCI, building their libs with MinGW.
I ran into the following problem.
PostgreSQL defines this strcuture @ pthread.h:
#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1
struct timespec {
long tv_sec;
long tv_nsec;
};
#endif /* HAVE_STRUCT_TIMESPEC */
But into the compiler, there is also this structure @ timeb.h
#ifndef _TIMESPEC_DEFINED
#define _TIMESPEC_DEFINED
struct timespec {
time_t tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
};
struct itimerspec {
struct timespec it_interval; /* Timer period */
struct timespec it_value; /* Timer expiration */
};
#endif
This is causing duplicate declaration of timespec. My questions are:
- Can I just edit the macros at postgresql to avoid this to be declared twice?
- If so, would this time_t and long difference of timespec.tv_spec's type be a problem?
- What would be a good way to fix this situation?
I am using PostgreSQL 9.3 x86