diff --git a/lib/timeval.h b/lib/timeval.h
index 4158423c6a21e38ed52ab36b89d142e77942e792..0a4253d425d6866956643ee31d36383ce4714c55 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -40,6 +40,8 @@
  * ------------------------------------------------------------
  ****************************************************************************/
 
+#include "setup.h"
+
 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
 #include <time.h>
 #include <winsock.h>
@@ -47,7 +49,6 @@
 #include <sys/time.h>
 #endif
 
-#include "setup.h"
 
 #ifndef HAVE_GETTIMEOFDAY
 #if !defined(_WINSOCKAPI_) && !defined(__MINGW32__)