win32: only declare struct timespec when needed
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 30 May 2012 13:47:22 +0000 (15:47 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 31 May 2012 19:39:05 +0000 (21:39 +0200)
To make mingw cross compilation on Fedora 17 work.

[CC] src/common/autobuf.c
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/time.h:277:0,
                 from src/defs.h:54,
                 from src/common/autobuf.h:47,
                 from src/common/autobuf.c:42:
/usr/i686-w64-mingw32/sys-root/mingw/include/sys/timeb.h:90:8: error: redefinition of 'struct timespec'
In file included from src/defs.h:46:0,
                 from src/common/autobuf.h:47,
                 from src/common/autobuf.c:42:
./src/win32/sys/time.h:82:8: note: originally defined here

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/win32/sys/time.h

index 7c41b5c..0a5a3fa 100644 (file)
   while (0)
 
 #if !defined WINCE
+
+#ifndef _TIMESPEC_DEFINED
+#define _TIMESPEC_DEFINED
 struct timespec {
   unsigned int tv_sec;
   unsigned int tv_nsec;
 };
+#endif
 #else
 #include <time.h>
 #endif