# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
# include <stddef.h>
-/* Windows does not support the ssize_t type, so map it to off_t... */
-typedef off_t ssize_t; /* @private@ */
+/* Windows does not support the ssize_t type, so map it to long... */
+typedef long ssize_t; /* @private@ */
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
# include "file.h"
int *cancel) /* I - Pointer to "cancel" variable */
{
int val; /* Socket option value */
-#ifdef O_NONBLOCK
- int flags, /* Socket flags */
- remaining; /* Remaining timeout */
+#ifndef WIN32
+ int flags; /* Socket flags */
+#endif /* !WIN32 */
+ int remaining; /* Remaining timeout */
int i, /* Looping var */
nfds, /* Number of file descriptors */
fds[100], /* Socket file descriptors */
result; /* Result from select() or poll() */
http_addrlist_t *addrs[100]; /* Addresses */
+#ifndef HAVE_POLL
+ int max_fd = -1; /* Highest file descriptor */
+#endif /* !HAVE_POLL */
+#ifdef O_NONBLOCK
# ifdef HAVE_POLL
struct pollfd pfds[100]; /* Polled file descriptors */
# else
- int max_fd = -1; /* Highest file descriptor */
fd_set input_set, /* select() input set */
output_set; /* select() output set */
struct timeval timeout; /* Timeout */
continue;
}
+#ifndef WIN32
fcntl(fds[nfds], F_SETFL, flags);
+#endif /* !WIN32 */
#ifndef HAVE_POLL
if (fds[nfds] > max_fd)
# include <bstring.h>
# endif /* HAVE_BSTRING_H */
+# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+# define __CUPS_SSIZE_T_DEFINED
+# include <stddef.h>
+/* Windows does not support the ssize_t type, so map it to long... */
+typedef long ssize_t; /* @private@ */
+# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
+
/*
* C++ magic...