summaryrefslogtreecommitdiff
path: root/libusb/os/windows_compat.c
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-02-03 01:04:41 +0000
committerPete Batard <pbatard@gmail.com>2010-02-03 01:04:41 +0000
commit3138936c41679fb881dbacc5f94da38208e6b053 (patch)
tree9851d682f3c40c295001bac0761a48c9aa05a117 /libusb/os/windows_compat.c
parent05ac09d594ac6cbb907e2d39667f23a0462f0405 (diff)
downloadlibusb-3138936c41679fb881dbacc5f94da38208e6b053.tar.gz
r138: additional DDK/SDK versions checks for cancel_io inline (MSVC7+ users only)r138
Diffstat (limited to 'libusb/os/windows_compat.c')
-rw-r--r--libusb/os/windows_compat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libusb/os/windows_compat.c b/libusb/os/windows_compat.c
index ee6a8df..717cf7b 100644
--- a/libusb/os/windows_compat.c
+++ b/libusb/os/windows_compat.c
@@ -67,6 +67,10 @@
#include <stdlib.h>
#include <stdint.h>
#include <io.h>
+#if defined(_MSC_VER) && (_MSC_VER > 1200)
+// For VER_PRODUCTBUILD used in the cancel_io inline
+#include <ntverp.h>
+#endif
#include "windows_compat.h"
@@ -144,7 +148,7 @@ __inline BOOL cancel_io(int index)
return CancelIo(poll_fd[index].handle);
}
// cygwin and MinGW don't have Ex for now...
-#if !defined(_MSC_VER)
+#if !defined(_MSC_VER) || !defined(VER_PRODUCTBUILD) || (VER_PRODUCTBUILD<6000)
return CancelIo(poll_fd[index].handle);
#else
return CancelIoEx(poll_fd[index].handle, poll_fd[index].overlapped);
@@ -159,6 +163,7 @@ void init_polling(void)
while (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) {
SleepEx(0, TRUE);
}
+ printf("\n\n\nver prod = %d\n\n\n", VER_PRODUCTBUILD);
if (!is_polling_set) {
for (i=0; i<MAX_FDS; i++) {
poll_fd[i] = INVALID_WINFD;