fix includes
[awesomized/libmemcached] / src / libmemcached / poll.cc
index b8324caa98876c93a8e1e38119913a301b501a36..5914aa47655236070f2e741b94d7da98e7e2121d 100644 (file)
 
 #if defined(_WIN32)
 #  include "libmemcached/poll.h"
-
-#  include <sys/time.h>
-#  include <strings.h>
+#  if HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  endif
+#  include <time.h>
+#  if HAVE_STRINGS_H
+#    include <cstrings>
+#  endif
 
 int poll(struct pollfd fds[], nfds_t nfds, int tmo) {
   fd_set readfds, writefds, errorfds;
@@ -45,7 +49,7 @@ int poll(struct pollfd fds[], nfds_t nfds, int tmo) {
     }
   }
 
-  struct timeval timeout = {.tv_sec = tmo / 1000, .tv_usec = (tmo % 1000) * 1000};
+  struct timeval timeout = {tmo / 1000, (tmo % 1000) * 1000};
   struct timeval *tp = &timeout;
   if (tmo == -1) {
     tp = NULL;