--- a/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c Mon Jan 20 09:20:13 2014 +0100
+++ b/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c Mon Jan 20 09:24:25 2014 +0100
@@ -33,13 +33,15 @@
#define FD_SETSIZE 1024
#include <stdlib.h>
+#include <winsock2.h>
+
#include "jvm.h"
#include "jni.h"
#include "jni_util.h"
#include "sun_nio_ch_WindowsSelectorImpl.h"
#include "sun_nio_ch_PollArrayWrapper.h"
-#include "winsock2.h"
+#include "nio_util.h" /* Needed for POLL* constants (includes "winsock2.h") */
typedef struct {
jint fd;
@@ -79,12 +81,11 @@
/* Set FD_SET structures required for select */
for (i = 0; i < numfds; i++) {
- if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) {
+ if (fds[i].events & POLLIN) {
readfds.fd_array[read_count] = fds[i].fd;
read_count++;
}
- if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT |
- sun_nio_ch_PollArrayWrapper_POLLCONN))
+ if (fds[i].events & (POLLOUT | POLLCONN))
{
writefds.fd_array[write_count] = fds[i].fd;
write_count++;
@@ -110,12 +111,11 @@
/* prepare select structures for the i-th socket */
errreadfds.fd_count = 0;
errwritefds.fd_count = 0;
- if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) {
+ if (fds[i].events & POLLIN) {
errreadfds.fd_array[0] = fds[i].fd;
errreadfds.fd_count = 1;
}
- if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT |
- sun_nio_ch_PollArrayWrapper_POLLCONN))
+ if (fds[i].events & (POLLOUT | POLLCONN))
{
errwritefds.fd_array[0] = fds[i].fd;
errwritefds.fd_count = 1;