]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Sync up some Windows build fixes from the ippsample fork.
authorMichael R Sweet <michaelrsweet@gmail.com>
Mon, 8 Aug 2016 16:42:20 +0000 (12:42 -0400)
committerMichael R Sweet <michaelrsweet@gmail.com>
Mon, 8 Aug 2016 16:42:20 +0000 (12:42 -0400)
cups/cups.h
cups/http-addrlist.c
cups/string-private.h

index 7001ba4bc065faaae85e839ed7001cf9ecd04095..c9bea806ddb9fbb801d79ff8be9ba7c0ce64e539 100644 (file)
@@ -24,8 +24,8 @@
 #  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"
index a8237eb034ac182a452a11b81dede77fd4f5704d..a1a7c5c12fecef8c5afc557ff8e0dec034224e18 100644 (file)
@@ -61,18 +61,22 @@ httpAddrConnect2(
     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 */
@@ -220,7 +224,9 @@ httpAddrConnect2(
        continue;
       }
 
+#ifndef WIN32
       fcntl(fds[nfds], F_SETFL, flags);
+#endif /* !WIN32 */
 
 #ifndef HAVE_POLL
       if (fds[nfds] > max_fd)
index 0868cbacd82c55ef3e2d82a494cb3a44eac76b2e..8b1140bce32060cb844befdadc6537a15e346157 100644 (file)
 #    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...