THRIFT-1490 Windows-specific header files - fixes & tweaks
Patch: Peace C

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1232397 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/windows/TargetVersion.h b/lib/cpp/src/windows/TargetVersion.h
index c8498b1..8c392fc 100644
--- a/lib/cpp/src/windows/TargetVersion.h
+++ b/lib/cpp/src/windows/TargetVersion.h
@@ -28,9 +28,8 @@
 #error This is a MSVC header only.
 #endif
 
-#include <winsdkver.h>
-
+#ifndef _WIN32_WINNT
 #define _WIN32_WINNT 0x0601
-#include <SDKDDKVer.h>
+#endif
 
 #endif //_THIRFT_WINDOWS_TARGETVERSION_H_
diff --git a/lib/cpp/src/windows/config.h b/lib/cpp/src/windows/config.h
index 95a5676..79168cf 100644
--- a/lib/cpp/src/windows/config.h
+++ b/lib/cpp/src/windows/config.h
@@ -30,8 +30,6 @@
 
 #pragma warning(disable: 4996) // Depreciated posix name.
 #pragma warning(disable: 4250) // Inherits via dominance.
-#pragma warning(disable: 4244) // conversion from '...' to '...', possible loss of data.
-#pragma warning(disable: 4267) // conversion from '...' to '...', possible loss of data.
 
 #define VERSION "0.9.0-dev"
 #define HAVE_GETTIMEOFDAY 1
@@ -84,7 +82,15 @@
 #define poll(fds, nfds, timeout) \
     poll_win32(fds, nfds, timeout)
 
-inline int poll_win32(LPWSAPOLLFD fdArray, ULONG fds, INT timeout)
+typedef struct pollfd {
+
+    SOCKET  fd;
+    SHORT   events;
+    SHORT   revents;
+
+} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
+
+inline int poll_win32(LPWSAPOLLFD fdArray, ULONG /*fds*/, INT timeout)
 {
     fd_set read_fds;
     fd_set write_fds;
@@ -98,7 +104,7 @@
     FD_SET(fdArray[0].fd, &write_fds);
     FD_SET(fdArray[0].fd, &except_fds);
 
-    timeval time_out = {timeout * 0.001, timeout * 1000};
+    timeval time_out = {timeout / 1000, timeout * 1000};
     return select(1, &read_fds, &write_fds, &except_fds, &time_out);
 }
 #else