]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Switch to _WIN32 for Windows test.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 17 Oct 2018 17:09:57 +0000 (13:09 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 17 Oct 2018 17:09:57 +0000 (13:09 -0400)
53 files changed:
backend/lpd.c
backend/socket.c
backend/test1284.c
backend/usb.c
cgi-bin/cgi.h
cups/adminutil.c
cups/auth.c
cups/backchannel.c
cups/cups.h
cups/debug-private.h
cups/debug.c
cups/dest.c
cups/dir.c
cups/file-private.h
cups/file.c
cups/file.h
cups/getputfile.c
cups/globals.c
cups/http-addr.c
cups/http-addrlist.c
cups/http-private.h
cups/http-support.c
cups/http.c
cups/http.h
cups/ipp.c
cups/language.c
cups/ppd-emit.c
cups/ppd-util.c
cups/ppd.c
cups/raster-private.h
cups/request.c
cups/sidechannel.c
cups/snmp.c
cups/string-private.h
cups/tempfile.c
cups/testarray.c
cups/testfile.c
cups/testipp.c
cups/testppd.c
cups/thread-private.h
cups/thread.c
cups/tls.c
cups/usersys.c
cups/util.c
filter/raster.c
ppdc/ppdc-source.cxx
scheduler/cupsd.h
scheduler/type.c
systemv/cupstestppd.c
test/ippfind.c
test/ippserver.c
test/ipptool.c
vcnet/config.h

index 4325b7c78898db975ac34fbf1fbaaaea1ffdb55e..d8c2e6b155e2ee57e70be146f3cafd027383f94e 100644 (file)
 #include <sys/stat.h>
 #include <stdio.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <winsock.h>
 #else
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
 #  include <netdb.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #ifdef __APPLE__
 #  include <CoreFoundation/CFNumber.h>
 #  include <CoreFoundation/CFPreferences.h>
@@ -623,11 +623,11 @@ cups_rresvport(int *port,         /* IO - Port number to bind to */
   * -1...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   closesocket(fd);
 #else
   close(fd);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
   return (-1);
 }
@@ -735,11 +735,11 @@ lpd_queue(const char      *hostname,      /* I - Host to connect to */
   ssize_t              nbytes;         /* Number of bytes written */
   off_t                        tbytes;         /* Total bytes written */
   char                 buffer[32768];  /* Output buffer */
-#ifdef WIN32
+#ifdef _WIN32
   DWORD                        tv;             /* Timeout in milliseconds */
 #else
   struct timeval       tv;             /* Timeout in secs and usecs */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
  /*
@@ -922,7 +922,7 @@ lpd_queue(const char      *hostname,        /* I - Host to connect to */
     * Set the timeout...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     tv = (DWORD)(timeout * 1000);
 
     setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
@@ -933,7 +933,7 @@ lpd_queue(const char      *hostname,        /* I - Host to connect to */
 
     setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
     setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     fputs("STATE: -connecting-to-device\n", stderr);
     _cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
index c16a1a097d2976d1e914158c936a71034d49f103..daeafe20df48b64a0350b5c77c1903bd6e9199b4 100644 (file)
@@ -23,7 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <winsock.h>
 #else
 #  include <unistd.h>
@@ -32,7 +32,7 @@
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
 #  include <netdb.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index 85ac8b5b3464f657d5ed18b502ffb313785f16ae..b55bb8e0e3e9ee39e4560fcddba8c2b1251f0691 100644 (file)
  */
 
 #include <cups/string-private.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
 #  include <fcntl.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #include "ieee1284.c"
 
index a3b6fba097f74d15f2c445be43553c133c51d691..b71f21dc3643e088013ba60cabda3c7f9cfd3c20 100644 (file)
 
 #include "backend-private.h"
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
 #  include <fcntl.h>
 #  include <termios.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index 0c360cb18a97a2c9bd2f7937b242da885575bacc..c2e5789396285be1939e9367cdd8553ac6857bb9 100644 (file)
 #  include <time.h>
 #  include <sys/stat.h>
 
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <direct.h>
 #    include <io.h>
 #  else
 #    include <unistd.h>
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 #  include <cups/cups.h>
 #  include <cups/array.h>
index adb1f7ae32b0d9a8d4a92a0df4c6590212fe2aee..375b9054e930aaaab9264926a33912d35590e482 100644 (file)
 #include "adminutil.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#ifdef WIN32
+#ifdef _WIN32
 #else
 #  include <unistd.h>
 #  include <sys/wait.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -2087,7 +2087,7 @@ do_samba_command(const char *command,     /* I - Command to run */
                 const char *authfile,  /* I - Samba authentication file */
                 FILE *logfile)         /* I - Optional log file */
 {
-#ifdef WIN32
+#ifdef _WIN32
   return (1);                          /* Always fail on Windows... */
 
 #else
@@ -2154,7 +2154,7 @@ do_samba_command(const char *command,     /* I - Command to run */
     return (WEXITSTATUS(status));
   else
     return (-WTERMSIG(status));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -2172,9 +2172,9 @@ get_cupsd_conf(
     int             *remote)           /* O - Remote file? */
 {
   int          fd;                     /* Temporary file descriptor */
-#ifndef WIN32
+#ifndef _WIN32
   struct stat  info;                   /* cupsd.conf file information */
-#endif /* WIN32 */
+#endif /* _WIN32 */
   http_status_t        status;                 /* Status of getting cupsd.conf */
   char         host[HTTP_MAX_HOST];    /* Hostname for connection */
 
@@ -2191,7 +2191,7 @@ get_cupsd_conf(
   snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
   *remote = 0;
 
-#ifndef WIN32
+#ifndef _WIN32
   if (!_cups_strcasecmp(host, "localhost") && !access(name, R_OK))
   {
    /*
@@ -2218,7 +2218,7 @@ get_cupsd_conf(
       status = HTTP_STATUS_OK;
   }
   else
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   {
    /*
     * Read cupsd.conf via a HTTP GET request...
index a798bdbb338881447cc0cc4b6eccd6f4c7866db5..a1f50423c4b397a40b00e82eafcd71c4f85960ac 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 #if HAVE_AUTHORIZATION_H
 #  include <Security/Authorization.h>
@@ -901,9 +901,9 @@ static int                          /* O - 0 if available */
                                        /*    -1 error */
 cups_local_auth(http_t *http)          /* I - HTTP connection to server */
 {
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
  /*
-  * Currently WIN32 and OS-2 do not support the CUPS server...
+  * Currently _WIN32 and OS-2 do not support the CUPS server...
   */
 
   return (1);
@@ -1104,5 +1104,5 @@ cups_local_auth(http_t *http)             /* I - HTTP connection to server */
   }
 
   return (1);
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 }
index e804d45b7e9957e287174616c3f6246eea3f21c0..bca04dc389c9544570e1915331c01020c8d502b0 100644 (file)
 
 #include "cups.h"
 #include <errno.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #  include <fcntl.h>
 #else
 #  include <sys/time.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -77,11 +77,11 @@ cupsBackChannelRead(char   *buffer, /* I - Buffer to read into */
   * Read bytes from the pipe...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   return ((ssize_t)_read(3, buffer, (unsigned)bytes));
 #else
   return (read(3, buffer, bytes));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -139,11 +139,11 @@ cupsBackChannelWrite(
     * Write bytes to the pipe...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     count = (ssize_t)_write(3, buffer, (unsigned)(bytes - total));
 #else
     count = write(3, buffer, bytes - total);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     if (count < 0)
     {
index 92826d75b3dab48b00d66ed7326693f28501cf7e..d0bfc689dfa6dc112d08e88a1590aba40775bc50 100644 (file)
  */
 
 #  include <sys/types.h>
-#  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+#  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 */
+#  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
 
 #  include "file.h"
 #  include "ipp.h"
index 23a0ae1795a9285506666fb70991cf6e5c6ebb14..3aca6eeddd284571b6ee54d360898f0472ae7057 100644 (file)
@@ -67,7 +67,7 @@ extern "C" {
  */
 
 #  ifdef DEBUG
-#    ifdef WIN32
+#    ifdef _WIN32
 #      ifdef LIBCUPS2_EXPORTS
 #        define DLLExport __declspec(dllexport)
 #      else
@@ -75,7 +75,7 @@ extern "C" {
 #      endif /* LIBCUPS2_EXPORTS */
 #    else
 #      define DLLExport
-#    endif /* WIN32 */
+#    endif /* _WIN32 */
 #    define DEBUG_puts(x) _cups_debug_puts(x)
 #    define DEBUG_printf(x) _cups_debug_printf x
 #    define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
@@ -99,10 +99,10 @@ extern void DLLExport _cups_debug_puts(const char *s);
 extern void    DLLExport _cups_debug_set(const char *logfile,
                                          const char *level, const char *filter,
                                          int force);
-#  ifdef WIN32
+#  ifdef _WIN32
 extern int     _cups_gettimeofday(struct timeval *tv, void *tz);
 #    define gettimeofday(a,b) _cups_gettimeofday(a, b)
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 #  ifdef __cplusplus
 }
index bd244fe72a44b21a4fca07e0be352135daa27b7f..43eaad96abd64dfb203f84f97d7e18467ac93bd8 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "cups-private.h"
 #include "thread-private.h"
-#ifdef WIN32
+#ifdef _WIN32
 #  include <sys/timeb.h>
 #  include <time.h>
 #  include <io.h>
@@ -36,7 +36,7 @@ _cups_gettimeofday(struct timeval *tv,        /* I  - Timeval struct */
 #else
 #  include <sys/time.h>
 #  include <unistd.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #include <regex.h>
 #include <fcntl.h>
 
index 57a8dc95cfac07367ee9318962bd249abeb16bc6..7ef85a1b9150cccdc1f78fd571ccd0d06504b7d3 100644 (file)
@@ -2090,9 +2090,9 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
   cups_option_t        *option;                /* Current option */
   _ipp_option_t        *match;                 /* Matching attribute for option */
   FILE         *fp;                    /* File pointer */
-#ifndef WIN32
+#ifndef _WIN32
   const char   *home;                  /* HOME environment variable */
-#endif /* WIN32 */
+#endif /* _WIN32 */
   char         filename[1024];         /* lpoptions file */
   int          num_temps;              /* Number of temporary destinations */
   cups_dest_t  *temps = NULL,          /* Temporary destinations */
@@ -2126,7 +2126,7 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
 
   snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
 
-#ifndef WIN32
+#ifndef _WIN32
   if (getuid())
   {
    /*
@@ -2152,7 +2152,7 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
       snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
     }
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Try to open the file...
@@ -2164,7 +2164,7 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
     return (-1);
   }
 
-#ifndef WIN32
+#ifndef _WIN32
  /*
   * Set the permissions to 0644 when saving to the /etc/cups/lpoptions
   * file...
@@ -2172,7 +2172,7 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
 
   if (!getuid())
     fchmod(fileno(fp), 0644);
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Write each printer; each line looks like:
index b7cd400cbd268a2075ee87af19852198a476ba50..fedceb9cb9a3eb5e5eb21109e00cddc116a6c4ba 100644 (file)
@@ -26,7 +26,7 @@
  * Windows implementation...
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 
 /*
@@ -145,7 +145,7 @@ cupsDirOpen(const char *directory)  /* I - Directory name */
 cups_dentry_t *                                /* O - Directory entry or @code NULL@ if there are no more */
 cupsDirRead(cups_dir_t *dp)            /* I - Directory pointer */
 {
-  WIN32_FIND_DATA      entry;          /* Directory entry data */
+  _WIN32_FIND_DATA     entry;          /* Directory entry data */
 
 
  /*
@@ -422,4 +422,4 @@ cupsDirRewind(cups_dir_t *dp)               /* I - Directory pointer */
 
   rewinddir(dp->dir);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
index 0f01eb7d100c491919e65693baf40af3f8b9745d..6789283e2d5e77f89ac5314bd3c4ed6242759849 100644 (file)
 #  include <stdarg.h>
 #  include <fcntl.h>
 
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #    include <sys/locking.h>
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 
 /*
index 2a18a61874da9ceeae12824be96a6874233bc637..5c9ddf8fe5c92db1491ca29a260b8352939d898a 100644 (file)
@@ -73,7 +73,7 @@ static ssize_t        cups_read(cups_file_t *fp, char *buf, size_t bytes);
 static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
 
 
-#ifndef WIN32
+#ifndef _WIN32
 /*
  * '_cupsFileCheck()' - Check the permissions of the given filename.
  */
@@ -339,7 +339,7 @@ _cupsFileCheckFilter(
 
   fprintf(stderr, "%s: %s\n", prefix, message);
 }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
 /*
@@ -559,22 +559,22 @@ cupsFileFind(const char *filename,        /* I - File to find */
 
   while (*path)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (*path == ';' || (*path == ':' && ((bufptr - buffer) > 1 || !isalpha(buffer[0] & 255))))
 #else
     if (*path == ';' || *path == ':')
-#endif /* WIN32 */
+#endif /* _WIN32 */
     {
       if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
         *bufptr++ = '/';
 
       strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
 
-#ifdef WIN32
+#ifdef _WIN32
       if (!access(buffer, 0))
 #else
       if (!access(buffer, executable ? X_OK : 0))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
         DEBUG_printf(("1cupsFileFind: Returning \"%s\"", buffer));
         return (buffer);
@@ -1025,11 +1025,11 @@ cupsFileLock(cups_file_t *fp,           /* I - CUPS file */
   * Try the lock...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   return (_locking(fp->fd, block ? _LK_LOCK : _LK_NBLCK, 0));
 #else
   return (lockf(fp->fd, block ? F_LOCK : F_TLOCK, 0));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -1117,11 +1117,11 @@ cupsFileOpen(const char *filename,      /* I - Name of file */
        }
 
        if (fd >= 0)
-#ifdef WIN32
+#ifdef _WIN32
          _chsize(fd, 0);
 #else
          ftruncate(fd, 0);
-#endif /* WIN32 */
+#endif /* _WIN32 */
         break;
 
     case 's' : /* Read/write socket */
@@ -1288,9 +1288,9 @@ cupsFileOpenFd(int        fd,             /* I - File descriptor */
   * Don't pass this file to child processes...
   */
 
-#ifndef WIN32
+#ifndef _WIN32
   fcntl(fp->fd, F_SETFD, fcntl(fp->fd, F_GETFD) | FD_CLOEXEC);
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
   return (fp);
 }
@@ -2064,11 +2064,11 @@ cupsFileUnlock(cups_file_t *fp)         /* I - CUPS file */
   * Unlock...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   return (_locking(fp->fd, _LK_UNLCK, 0));
 #else
   return (lockf(fp->fd, F_ULOCK, 0));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -2598,9 +2598,9 @@ cups_open(const char *filename,           /* I - Filename */
 {
   int          fd;                     /* File descriptor */
   struct stat  fileinfo;               /* File information */
-#ifndef WIN32
+#ifndef _WIN32
   struct stat  linkinfo;               /* Link information */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
  /*
@@ -2628,18 +2628,18 @@ cups_open(const char *filename,         /* I - Filename */
     return (-1);
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   if (fileinfo.st_mode & _S_IFDIR)
 #else
   if (S_ISDIR(fileinfo.st_mode))
-#endif /* WIN32 */
+#endif /* _WIN32 */
   {
     close(fd);
     errno = EISDIR;
     return (-1);
   }
 
-#ifndef WIN32
+#ifndef _WIN32
  /*
   * Then use lstat to determine whether the filename is a symlink...
   */
@@ -2667,7 +2667,7 @@ cups_open(const char *filename,           /* I - Filename */
     errno = EPERM;
     return (-1);
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
   return (fd);
 }
@@ -2693,7 +2693,7 @@ cups_read(cups_file_t *fp,                /* I - CUPS file */
 
   for (;;)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (fp->mode == 's')
       total = (ssize_t)recv(fp->fd, buf, (unsigned)bytes, 0);
     else
@@ -2703,7 +2703,7 @@ cups_read(cups_file_t *fp,                /* I - CUPS file */
       total = recv(fp->fd, buf, bytes, 0);
     else
       total = read(fp->fd, buf, bytes);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     DEBUG_printf(("9cups_read: total=" CUPS_LLFMT, CUPS_LLCAST total));
 
@@ -2750,7 +2750,7 @@ cups_write(cups_file_t *fp,               /* I - CUPS file */
   total = 0;
   while (bytes > 0)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (fp->mode == 's')
       count = (ssize_t)send(fp->fd, buf, (unsigned)bytes, 0);
     else
@@ -2760,7 +2760,7 @@ cups_write(cups_file_t *fp,               /* I - CUPS file */
       count = send(fp->fd, buf, bytes, 0);
     else
       count = write(fp->fd, buf, bytes);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     DEBUG_printf(("9cups_write: count=" CUPS_LLFMT, CUPS_LLCAST count));
 
index 42abe2086df5049f9a80ae96efcf63322e294e1d..73721d46805a68e02022f9f2b2e16066ef2f9f9c 100644 (file)
 #  include "versioning.h"
 #  include <stddef.h>
 #  include <sys/types.h>
-#  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+#  if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
 #    define __CUPS_SSIZE_T_DEFINED
 /* Windows does not support the ssize_t type, so map it to off_t... */
 typedef off_t ssize_t;                 /* @private@ */
-#  endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
+#  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
 
 
 /*
index 60edbf83fb572efe5f4b88b4d11462d23ea01f97..7749ae0a8b36f938f789f8e3b31e8622415210c8 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 
 /*
index 8a05c3eb1f45291aafb6c4af211f1cbbc0e7b56d..28c993be73324cfcc185a9b42d0ab3c23733f884 100644 (file)
@@ -34,23 +34,23 @@ static _cups_threadkey_t cups_globals_key = _CUPS_THREADKEY_INITIALIZER;
 static pthread_once_t  cups_globals_key_once = PTHREAD_ONCE_INIT;
                                        /* One-time initialization object */
 #endif /* HAVE_PTHREAD_H */
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static _cups_mutex_t   cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
                                        /* Global critical section */
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
 
 
 /*
  * Local functions...
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 static void            cups_fix_path(char *path);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 static _cups_globals_t *cups_globals_alloc(void);
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void            cups_globals_free(_cups_globals_t *g);
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
 #ifdef HAVE_PTHREAD_H
 static void            cups_globals_init(void);
 #endif /* HAVE_PTHREAD_H */
@@ -65,7 +65,7 @@ _cupsGlobalLock(void)
 {
 #ifdef HAVE_PTHREAD_H
   pthread_mutex_lock(&cups_global_mutex);
-#elif defined(WIN32)
+#elif defined(_WIN32)
   EnterCriticalSection(&cups_global_mutex.m_criticalSection);
 #endif /* HAVE_PTHREAD_H */
 }
@@ -120,13 +120,13 @@ _cupsGlobalUnlock(void)
 {
 #ifdef HAVE_PTHREAD_H
   pthread_mutex_unlock(&cups_global_mutex);
-#elif defined(WIN32)
+#elif defined(_WIN32)
   LeaveCriticalSection(&cups_global_mutex.m_criticalSection);
 #endif /* HAVE_PTHREAD_H */
 }
 
 
-#ifdef WIN32
+#ifdef _WIN32
 /*
  * 'DllMain()' - Main entry for library.
  */
@@ -170,7 +170,7 @@ DllMain(HINSTANCE hinst,            /* I - DLL module handle */
 
   return (TRUE);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -182,13 +182,13 @@ cups_globals_alloc(void)
 {
   _cups_globals_t *cg = malloc(sizeof(_cups_globals_t));
                                        /* Pointer to global data */
-#ifdef WIN32
+#ifdef _WIN32
   HKEY         key;                    /* Registry key */
   DWORD                size;                   /* Size of string */
   static char  installdir[1024] = "",  /* Install directory */
                confdir[1024] = "",     /* Server root directory */
                localedir[1024] = "";   /* Locale directory */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
   if (!cg)
@@ -219,7 +219,7 @@ cups_globals_alloc(void)
   * Then set directories as appropriate...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   if (!installdir[0])
   {
    /*
@@ -315,7 +315,7 @@ cups_globals_alloc(void)
     if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
       cg->localedir = CUPS_LOCALEDIR;
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
   return (cg);
 }
@@ -325,7 +325,7 @@ cups_globals_alloc(void)
  * 'cups_globals_free()' - Free global data.
  */
 
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void
 cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
 {
@@ -360,7 +360,7 @@ cups_globals_free(_cups_globals_t *cg)      /* I - Pointer to global data */
 
   free(cg);
 }
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
 
 
 #ifdef HAVE_PTHREAD_H
index 61c86384b2e3fae3bee5b6e43675ae88a99caad1..f8b8131c34bffd3d99b5c430c04d0a3a405c1dc0 100644 (file)
@@ -69,11 +69,11 @@ int                                         /* O - 0 on success, -1 on failure */
 httpAddrClose(http_addr_t *addr,               /* I - Listen address or @code NULL@ */
               int         fd)                  /* I - Socket file descriptor */
 {
-#ifdef WIN32
+#ifdef _WIN32
   if (closesocket(fd))
 #else
   if (close(fd))
-#endif /* WIN32 */
+#endif /* _WIN32 */
     return (-1);
 
 #ifdef AF_LOCAL
@@ -258,9 +258,9 @@ httpAddrListen(http_addr_t *addr,   /* I - Address to bind to */
   * Close on exec...
   */
 
-#ifndef WIN32
+#ifndef _WIN32
   fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 #ifdef SO_NOSIGPIPE
  /*
index 3e0f2ca0125bc1f2c2623e7bc3d7815b38ee252e..a7d5abcfa1835093b5d9426be6271c35b6710805 100644 (file)
@@ -24,9 +24,9 @@
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
-#ifndef WIN32
+#ifndef _WIN32
 #  include <fcntl.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -61,9 +61,9 @@ httpAddrConnect2(
     int             *cancel)           /* I - Pointer to "cancel" variable */
 {
   int                  val;            /* Socket option value */
-#ifndef WIN32
+#ifndef _WIN32
   int                  flags;          /* Socket flags */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   int                  remaining;      /* Remaining timeout */
   int                  i, j,           /* Looping vars */
                        nfds,           /* Number of file descriptors */
@@ -213,11 +213,11 @@ httpAddrConnect2(
        return (addrlist);
       }
 
-#ifdef WIN32
+#ifdef _WIN32
       if (WSAGetLastError() != WSAEINPROGRESS && WSAGetLastError() != WSAEWOULDBLOCK)
 #else
       if (errno != EINPROGRESS && errno != EWOULDBLOCK)
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
        DEBUG_printf(("1httpAddrConnect2: Unable to connect to %s:%d: %s", httpAddrString(&(addrlist->addr), temp, sizeof(temp)), httpAddrPort(&(addrlist->addr)), strerror(errno)));
        httpAddrClose(NULL, fds[nfds]);
@@ -225,9 +225,9 @@ httpAddrConnect2(
        continue;
       }
 
-#ifndef WIN32
+#ifndef _WIN32
       fcntl(fds[nfds], F_SETFL, flags);
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 #ifndef HAVE_POLL
       if (fds[nfds] > max_fd)
@@ -296,11 +296,11 @@ httpAddrConnect2(
       DEBUG_printf(("1httpAddrConnect2: select() returned %d (%d)", result, errno));
 #  endif /* HAVE_POLL */
     }
-#  ifdef WIN32
+#  ifdef _WIN32
     while (result < 0 && (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK));
 #  else
     while (result < 0 && (errno == EINTR || errno == EAGAIN));
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
     if (result > 0)
     {
@@ -377,11 +377,11 @@ httpAddrConnect2(
     httpAddrClose(NULL, fds[nfds]);
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, "Connection failed", 0);
 #else
   _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, strerror(errno), 0);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
   return (NULL);
 }
@@ -849,11 +849,11 @@ httpAddrGetList(const char *hostname,     /* I - Hostname, IP address, or NULL for p
 
         temp->addr.ipv6.sin6_family            = AF_INET6;
        temp->addr.ipv6.sin6_port              = htons(portnum);
-#  ifdef WIN32
+#  ifdef _WIN32
        temp->addr.ipv6.sin6_addr.u.Byte[15]   = 1;
 #  else
        temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
         if (!first)
           first = temp;
index be0533c4d16468bcb32527f3f41f1882f68384ae..32cb9ea5b2d10d5a63eb075886ec62ace862ca85 100644 (file)
@@ -30,7 +30,7 @@
 #  endif /* __sun */
 
 #  include <limits.h>
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #    include <winsock2.h>
 #    define CUPS_SOCAST (const char *)
@@ -39,7 +39,7 @@
 #    include <fcntl.h>
 #    include <sys/socket.h>
 #    define CUPS_SOCAST
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 #  ifdef HAVE_GSSAPI
 #    ifdef HAVE_GSS_GSSAPI_H
@@ -140,7 +140,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
 #    include <sspi.h>
 #  endif /* HAVE_GNUTLS */
 
-#  ifndef WIN32
+#  ifndef _WIN32
 #    include <net/if.h>
 #    include <resolv.h>
 #    ifdef HAVE_GETIFADDRS
@@ -151,7 +151,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
 #        include <sys/sockio.h>
 #      endif /* HAVE_SYS_SOCKIO_H */
 #    endif /* HAVE_GETIFADDRS */
-#  endif /* !WIN32 */
+#  endif /* !_WIN32 */
 
 
 /*
@@ -392,7 +392,7 @@ extern const char *_cups_hstrerror(int error);
  * Some OS's don't have getifaddrs() and freeifaddrs()...
  */
 
-#  if !defined(WIN32) && !defined(HAVE_GETIFADDRS)
+#  if !defined(_WIN32) && !defined(HAVE_GETIFADDRS)
 #    ifdef ifa_dstaddr
 #      undef ifa_dstaddr
 #    endif /* ifa_dstaddr */
@@ -427,7 +427,7 @@ extern int  _cups_getifaddrs(struct ifaddrs **addrs);
 #    define getifaddrs _cups_getifaddrs
 extern void    _cups_freeifaddrs(struct ifaddrs *addrs);
 #    define freeifaddrs _cups_freeifaddrs
-#  endif /* !WIN32 && !HAVE_GETIFADDRS */
+#  endif /* !_WIN32 && !HAVE_GETIFADDRS */
 
 
 /*
index 739953b31d73eac2425f0686394daa65dac5ed6a..aff48ab16905b1903d8817347d7581e79da8dbe4 100644 (file)
 #include "cups-private.h"
 #ifdef HAVE_DNSSD
 #  include <dns_sd.h>
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #  elif defined(HAVE_POLL)
 #    include <poll.h>
 #  else
 #    include <sys/select.h>
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 #elif defined(HAVE_AVAHI)
 #  include <avahi-client/client.h>
 #  include <avahi-client/lookup.h>
@@ -1768,9 +1768,9 @@ _httpResolveURI(
     _http_uribuf_t     uribuf;         /* URI buffer */
     int                        offline = 0;    /* offline-report state set? */
 #  ifdef HAVE_DNSSD
-#    ifdef WIN32
+#    ifdef _WIN32
 #      pragma comment(lib, "dnssd.lib")
-#    endif /* WIN32 */
+#    endif /* _WIN32 */
     DNSServiceRef      ref,            /* DNS-SD master service reference */
                        domainref = NULL,/* DNS-SD service reference for domain */
                        ippref = NULL,  /* DNS-SD service reference for network IPP */
@@ -1899,11 +1899,11 @@ _httpResolveURI(
          FD_ZERO(&input_set);
          FD_SET(DNSServiceRefSockFD(ref), &input_set);
 
-#      ifdef WIN32
+#      ifdef _WIN32
          stimeout.tv_sec  = (long)timeout;
 #      else
          stimeout.tv_sec  = timeout;
-#      endif /* WIN32 */
+#      endif /* _WIN32 */
          stimeout.tv_usec = 0;
 
          fds = select(DNSServiceRefSockFD(ref)+1, &input_set, NULL, NULL,
index 2fe5ba003bb4fe1358c7c8907fa15c5e6cd7d49b..5c14ef68e11e34a82d9b4536667c8aed08475bb1 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <math.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <tchar.h>
 #else
 #  include <signal.h>
 #  include <sys/time.h>
 #  include <sys/resource.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
@@ -1197,11 +1197,11 @@ httpGets(char   *line,                  /* I - Line to read into */
     * Pre-load the buffer as needed...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     WSASetLastError(0);
 #else
     errno = 0;
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     while (http->used == 0)
     {
@@ -1215,11 +1215,11 @@ httpGets(char   *line,                  /* I - Line to read into */
          continue;
 
         DEBUG_puts("3httpGets: Timed out!");
-#ifdef WIN32
+#ifdef _WIN32
         http->error = WSAETIMEDOUT;
 #else
         http->error = ETIMEDOUT;
-#endif /* WIN32 */
+#endif /* _WIN32 */
         return (NULL);
       }
 
@@ -1233,7 +1233,7 @@ httpGets(char   *line,                    /* I - Line to read into */
        * Nope, can't get a line this time...
        */
 
-#ifdef WIN32
+#ifdef _WIN32
         DEBUG_printf(("3httpGets: recv() error %d!", WSAGetLastError()));
 
         if (WSAGetLastError() == WSAEINTR)
@@ -1270,7 +1270,7 @@ httpGets(char   *line,                    /* I - Line to read into */
          http->error = errno;
          continue;
        }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
         return (NULL);
       }
@@ -1537,9 +1537,9 @@ void
 httpInitialize(void)
 {
   static int   initialized = 0;        /* Have we been called before? */
-#ifdef WIN32
+#ifdef _WIN32
   WSADATA      winsockdata;            /* WinSock data */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
   _cupsGlobalLock();
@@ -1549,7 +1549,7 @@ httpInitialize(void)
     return;
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   WSAStartup(MAKEWORD(2,2), &winsockdata);
 
 #elif !defined(SO_NOSIGPIPE)
@@ -1571,7 +1571,7 @@ httpInitialize(void)
 #  else
   signal(SIGPIPE, SIG_IGN);
 #  endif /* !SO_NOSIGPIPE */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #  ifdef HAVE_SSL
   _httpTLSInitialize();
@@ -1859,7 +1859,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
 
   if (bytes < 0)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK)
       bytes = 0;
     else
@@ -1869,7 +1869,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
       bytes = 0;
     else
       http->error = errno;
-#endif /* WIN32 */
+#endif /* _WIN32 */
   }
   else if (bytes == 0)
   {
@@ -2430,11 +2430,11 @@ httpReconnect2(http_t *http,            /* I - HTTP connection */
     * Unable to connect...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     http->error  = WSAGetLastError();
 #else
     http->error  = errno;
-#endif /* WIN32 */
+#endif /* _WIN32 */
     http->status = HTTP_STATUS_ERROR;
 
     DEBUG_printf(("1httpReconnect2: httpAddrConnect failed: %s",
@@ -2771,11 +2771,11 @@ httpShutdown(http_t *http)              /* I - HTTP connection */
     _httpTLSStop(http);
 #endif /* HAVE_SSL */
 
-#ifdef WIN32
+#ifdef _WIN32
   shutdown(http->fd, SD_RECEIVE);      /* Microsoft-ism... */
 #else
   shutdown(http->fd, SHUT_RD);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -3109,12 +3109,12 @@ _httpWait(http_t *http,                 /* I - HTTP connection */
 
     DEBUG_printf(("6_httpWait: select() returned %d...", nfds));
   }
-#  ifdef WIN32
+#  ifdef _WIN32
   while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
                       WSAGetLastError() == WSAEWOULDBLOCK));
 #  else
   while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 #endif /* HAVE_POLL */
 
   DEBUG_printf(("5_httpWait: returning with nfds=%d, errno=%d...", nfds,
@@ -4149,7 +4149,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
 
     if (bytes < 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       if (WSAGetLastError() != WSAEINTR)
       {
        http->error = WSAGetLastError();
@@ -4185,7 +4185,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
        http->error = errno;
        return (-1);
       }
-#endif /* WIN32 */
+#endif /* _WIN32 */
     }
   }
   while (bytes < 0);
@@ -4199,7 +4199,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
 
   if (bytes < 0)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (WSAGetLastError() == WSAEINTR)
       bytes = 0;
     else
@@ -4209,7 +4209,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
       bytes = 0;
     else
       http->error = errno;
-#endif /* WIN32 */
+#endif /* _WIN32 */
   }
   else if (bytes == 0)
   {
@@ -4573,7 +4573,7 @@ static void
 http_set_timeout(int    fd,            /* I - File descriptor */
                  double timeout)       /* I - Timeout in seconds */
 {
-#ifdef WIN32
+#ifdef _WIN32
   DWORD tv = (DWORD)(timeout * 1000);
                                      /* Timeout in milliseconds */
 
@@ -4588,7 +4588,7 @@ http_set_timeout(int    fd,               /* I - File descriptor */
 
   setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, CUPS_SOCAST &tv, sizeof(tv));
   setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, CUPS_SOCAST &tv, sizeof(tv));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -4750,12 +4750,12 @@ http_write(http_t     *http,            /* I - HTTP connection */
 
          nfds = select(http->fd + 1, NULL, &output_set, NULL, &timeout);
        }
-#  ifdef WIN32
+#  ifdef _WIN32
        while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
                            WSAGetLastError() == WSAEWOULDBLOCK));
 #  else
        while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 #endif /* HAVE_POLL */
 
         if (nfds < 0)
@@ -4765,11 +4765,11 @@ http_write(http_t     *http,            /* I - HTTP connection */
        }
        else if (nfds == 0 && (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data)))
        {
-#ifdef WIN32
+#ifdef _WIN32
          http->error = WSAEWOULDBLOCK;
 #else
          http->error = EWOULDBLOCK;
-#endif /* WIN32 */
+#endif /* _WIN32 */
          return (-1);
        }
       }
@@ -4788,7 +4788,7 @@ http_write(http_t     *http,              /* I - HTTP connection */
 
     if (bytes < 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       if (WSAGetLastError() == WSAEINTR)
         continue;
       else if (WSAGetLastError() == WSAEWOULDBLOCK)
@@ -4822,7 +4822,7 @@ http_write(http_t     *http,              /* I - HTTP connection */
         http->error = errno;
        continue;
       }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
       DEBUG_printf(("3http_write: error writing data (%s).",
                     strerror(http->error)));
index fec4dc5aa71cc4c2090b509b45205ab9b226b3ac..9cc55e9187b3ecf90aa5f8335afa6f21cbcff27d 100644 (file)
@@ -25,7 +25,7 @@
 #  include <string.h>
 #  include <time.h>
 #  include <sys/types.h>
-#  ifdef WIN32
+#  ifdef _WIN32
 #    ifndef __CUPS_SSIZE_T_DEFINED
 #      define __CUPS_SSIZE_T_DEFINED
 /* Windows does not support the ssize_t type, so map it to off_t... */
@@ -54,7 +54,7 @@ typedef off_t ssize_t;                        /* @private@ */
 #    if defined(LOCAL_PEERCRED) && !defined(SO_PEERCRED)
 #      define SO_PEERCRED LOCAL_PEERCRED
 #    endif /* LOCAL_PEERCRED && !SO_PEERCRED */
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 
 /*
@@ -85,7 +85,7 @@ extern "C" {
 #    define s6_addr32  _S6_un._S6_u32
 #  elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
 #    define s6_addr32  __u6_addr.__u6_addr32
-#  elif defined(WIN32)
+#  elif defined(_WIN32)
 /*
  * Windows only defines byte and 16-bit word members of the union and
  * requires special casing of all raw address code...
index b243b35058840d0c41658128c77cb986021c5c50..ddec3a958ed1e2f5dead48a21087cdf9316e93de 100644 (file)
@@ -19,9 +19,9 @@
 
 #include "cups-private.h"
 #include <regex.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -6762,14 +6762,14 @@ ipp_read_http(http_t      *http,        /* I - Client connection */
 
     if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       break;
 #else
       if (errno != EAGAIN && errno != EINTR)
        break;
 
       bytes = 0;
-#endif /* WIN32 */
+#endif /* _WIN32 */
     }
     else if (bytes == 0)
       break;
@@ -6797,11 +6797,11 @@ ipp_read_file(int         *fd,          /* I - File descriptor */
               ipp_uchar_t *buffer,     /* O - Read buffer */
              size_t      length)       /* I - Number of bytes to read */
 {
-#ifdef WIN32
+#ifdef _WIN32
   return ((ssize_t)read(*fd, buffer, (unsigned)length));
 #else
   return (read(*fd, buffer, length));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -6969,9 +6969,9 @@ ipp_write_file(int         *fd,           /* I - File descriptor */
                ipp_uchar_t *buffer,    /* I - Data to write */
                size_t      length)     /* I - Number of bytes to write */
 {
-#ifdef WIN32
+#ifdef _WIN32
   return ((ssize_t)write(*fd, buffer, (unsigned)length));
 #else
   return (write(*fd, buffer, length));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
index e6d2d44aad459faea4ededb12b94a8555feae215..61280c0fb74b793575ef4f82cf958a0460d250b1 100644 (file)
 #ifdef HAVE_LANGINFO_H
 #  include <langinfo.h>
 #endif /* HAVE_LANGINFO_H */
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #ifdef HAVE_COREFOUNDATION_H
 #  include <CoreFoundation/CoreFoundation.h>
 #endif /* HAVE_COREFOUNDATION_H */
index 36e5bcaf48ff119c74deea6f1081a419ce351467..4b153aca692e4181e261e12cbe8462d07a18c70e 100644 (file)
 
 #include "cups-private.h"
 #include "ppd.h"
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 
 /*
@@ -328,11 +328,11 @@ ppdEmitFd(ppd_file_t    *ppd,             /* I - PPD file record */
 
     while (buflength > 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       if ((bytes = (ssize_t)write(fd, bufptr, (unsigned)buflength)) < 0)
 #else
       if ((bytes = write(fd, bufptr, buflength)) < 0)
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
         if (errno == EAGAIN || errno == EINTR)
          continue;
index 19c60e271f876ef9f9b04c83943e1871f5e299ad..0974bae92328bf47e85febe2f42e2609c11ea523 100644 (file)
 #include "ppd-private.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 
 /*
@@ -171,7 +171,7 @@ cupsGetPPD3(http_t     *http,               /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
     return (HTTP_STATUS_NOT_ACCEPTABLE);
   }
 
-#ifndef WIN32
+#ifndef _WIN32
  /*
   * See if the PPD file is available locally...
   */
@@ -298,7 +298,7 @@ cupsGetPPD3(http_t     *http,               /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
       }
     }
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Try finding a printer URI for this printer...
index 276e8485e1265dd0cd8ebf4ff6be0acc6fbcd62d..5f27484aa615d69336492caac95f83b45f0f4aaa 100644 (file)
@@ -94,9 +94,9 @@ static ppd_group_t    *ppd_get_group(ppd_file_t *ppd, const char *name,
                                       cups_encoding_t encoding);
 static ppd_option_t    *ppd_get_option(ppd_group_t *group, const char *name);
 static _ppd_globals_t  *ppd_globals_alloc(void);
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void            ppd_globals_free(_ppd_globals_t *g);
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
 #ifdef HAVE_PTHREAD_H
 static void            ppd_globals_init(void);
 #endif /* HAVE_PTHREAD_H */
@@ -2837,13 +2837,13 @@ ppd_globals_alloc(void)
  * 'ppd_globals_free()' - Free global data.
  */
 
-#if defined(HAVE_PTHREAD_H) || defined(WIN32)
+#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void
 ppd_globals_free(_ppd_globals_t *pg)   /* I - Pointer to global data */
 {
   free(pg);
 }
-#endif /* HAVE_PTHREAD_H || WIN32 */
+#endif /* HAVE_PTHREAD_H || _WIN32 */
 
 
 #ifdef HAVE_PTHREAD_H
index 38135815c135ceac02bd92cf6ec130f4f59d30db..86bd7e793b9ef1fc3dfe99b75f047c3cdb0d74bf 100644 (file)
 #  include <cups/cups.h>
 #  include <cups/debug-private.h>
 #  include <cups/string-private.h>
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #    include <winsock2.h>              /* for htonl() definition */
 #  else
 #    include <unistd.h>
 #    include <fcntl.h>
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 
 /*
index 16c30e86a59fda4eeaf534dbcd7e95f6e75bf838..a4e4b90533c299c8efeaf27b7ed3eb7a4bc41b97 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 #ifndef O_BINARY
 #  define O_BINARY 0
 #endif /* O_BINARY */
@@ -156,11 +156,11 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       return (NULL);
     }
 
-#ifdef WIN32
+#ifdef _WIN32
     if (fileinfo.st_mode & _S_IFDIR)
 #else
     if (S_ISDIR(fileinfo.st_mode))
-#endif /* WIN32 */
+#endif /* _WIN32 */
     {
      /*
       * Can't send a directory...
@@ -172,11 +172,11 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       return (NULL);
     }
 
-#ifndef WIN32
+#ifndef _WIN32
     if (!S_ISREG(fileinfo.st_mode))
       length = 0;                      /* Chunk when piping */
     else
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
     length = ippLength(request) + (size_t)fileinfo.st_size;
   }
   else
@@ -215,9 +215,9 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       * Send the file with the request...
       */
 
-#ifndef WIN32
+#ifndef _WIN32
       if (S_ISREG(fileinfo.st_mode))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       lseek(infile, 0, SEEK_SET);
 
       while ((bytes = read(infile, buffer, sizeof(buffer))) > 0)
@@ -1028,13 +1028,13 @@ _cupsConnect(void)
       char     ch;                     /* Connection check byte */
       ssize_t  n;                      /* Number of bytes */
 
-#ifdef WIN32
+#ifdef _WIN32
       if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK)) == 0 ||
           (n < 0 && WSAGetLastError() != WSAEWOULDBLOCK))
 #else
       if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT)) == 0 ||
           (n < 0 && errno != EWOULDBLOCK))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
        /*
         * Nope, close the connection...
index a4cd960aa20dbeb4afe92a9e5e6a831d5056f652..f2dbabd6919ca15545fa5417773adef137f6b40f 100644 (file)
 
 #include "sidechannel.h"
 #include "cups-private.h"
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
-#ifndef WIN32
+#endif /* _WIN32 */
+#ifndef _WIN32
 #  include <sys/select.h>
 #  include <sys/time.h>
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
index 7958b93e557e542dd28595d9ca28ef68765a1f2a..8437528dd0dd187ded93788a9a9b1b7ae84a7801 100644 (file)
@@ -395,11 +395,11 @@ _cupsSNMPRead(int         fd,             /* I - SNMP socket file descriptor */
 
       ready = select(fd + 1, &input_set, NULL, NULL, &stimeout);
     }
-#  ifdef WIN32
+#  ifdef _WIN32
     while (ready < 0 && WSAGetLastError() == WSAEINTR);
 #  else
     while (ready < 0 && (errno == EINTR || errno == EAGAIN));
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 #endif /* HAVE_POLL */
 
    /*
index e8448d17f1ee1845a9df92d58963275f1bfad7a4..53201f7c43532319a31965e05ff7783345b297dc 100644 (file)
 #    include <bstring.h>
 #  endif /* HAVE_BSTRING_H */
 
-#  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+#  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 */
+#  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
 
 
 /*
index 1e248694c8f7dcbcf818fdb6be1ecef81168f48f..7b341e13f90ed518ddc5c8d70de384694587d065 100644 (file)
 #include <stdlib.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 
 /*
@@ -42,21 +42,21 @@ cupsTempFd(char *filename,          /* I - Pointer to buffer */
   int          fd;                     /* File descriptor for temp file */
   int          tries;                  /* Number of tries */
   const char   *tmpdir;                /* TMPDIR environment var */
-#if defined(__APPLE__) || defined(WIN32)
+#if defined(__APPLE__) || defined(_WIN32)
   char         tmppath[1024];          /* Temporary directory */
-#endif /* __APPLE__ || WIN32 */
-#ifdef WIN32
+#endif /* __APPLE__ || _WIN32 */
+#ifdef _WIN32
   DWORD                curtime;                /* Current time */
 #else
   struct timeval curtime;              /* Current time */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
  /*
   * See if TMPDIR is defined...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   if ((tmpdir = getenv("TEMP")) == NULL)
   {
     GetTempPath(sizeof(tmppath), tmppath);
@@ -92,7 +92,7 @@ cupsTempFd(char *filename,            /* I - Pointer to buffer */
 
   if ((tmpdir = getenv("TMPDIR")) == NULL)
     tmpdir = "/tmp";
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
  /*
   * Make the temporary name using the specified directory...
@@ -102,7 +102,7 @@ cupsTempFd(char *filename,          /* I - Pointer to buffer */
 
   do
   {
-#ifdef WIN32
+#ifdef _WIN32
    /*
     * Get the current time of day...
     */
@@ -126,21 +126,21 @@ cupsTempFd(char *filename,                /* I - Pointer to buffer */
     */
 
     snprintf(filename, (size_t)len - 1, "%s/%05x%08x", tmpdir, (unsigned)getpid(), (unsigned)(curtime.tv_sec + curtime.tv_usec + tries));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
    /*
     * Open the file in "exclusive" mode, making sure that we don't
     * stomp on an existing file or someone's symlink crack...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     fd = open(filename, _O_CREAT | _O_RDWR | _O_TRUNC | _O_BINARY,
               _S_IREAD | _S_IWRITE);
 #elif defined(O_NOFOLLOW)
     fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
 #else
     fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     if (fd < 0 && errno != EEXIST)
       break;
index 6164ffc665568e03efd868669bb42aef65252a81..892e3250727e7a213689f4e6ffb3a07d19f5549e 100644 (file)
@@ -494,7 +494,7 @@ main(void)
  * 'get_seconds()' - Get the current time in seconds...
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 
 
@@ -515,7 +515,7 @@ get_seconds(void)
   gettimeofday(&curtime, NULL);
   return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index 6e1256b7fb67c919711e6c1424f7302b960d2831..1473a4a039987cf5c72c01f9cd8d50f4a58c2874 100644 (file)
 #include "file.h"
 #include <stdlib.h>
 #include <time.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #include <fcntl.h>
 
 
@@ -50,10 +50,10 @@ main(int  argc,                             /* I - Number of command-line arguments */
   int          status;                 /* Exit status */
   char         filename[1024];         /* Filename buffer */
   cups_file_t  *fp;                    /* File pointer */
-#ifndef WIN32
+#ifndef _WIN32
   int          fds[2];                 /* Open file descriptors */
   cups_file_t  *fdfile;                /* File opened with cupsFileOpenFd() */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   int          count;                  /* Number of lines in file */
 
 
@@ -81,7 +81,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
     status += random_tests();
 
-#ifndef WIN32
+#ifndef _WIN32
    /*
     * Test fdopen and close without reading...
     */
@@ -115,7 +115,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
       puts("PASS");
     }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
    /*
     * Count lines in psglyphs, rewind, then count again.
@@ -171,13 +171,13 @@ main(int  argc,                           /* I - Number of command-line arguments */
     */
 
     fputs("\ncupsFileFind: ", stdout);
-#ifdef WIN32
+#ifdef _WIN32
     if (cupsFileFind("notepad.exe", "C:/WINDOWS", 1, filename, sizeof(filename)) &&
        cupsFileFind("notepad.exe", "C:/WINDOWS;C:/WINDOWS/SYSTEM32", 1, filename, sizeof(filename)))
 #else
     if (cupsFileFind("cat", "/bin", 1, filename, sizeof(filename)) &&
        cupsFileFind("cat", "/bin:/usr/bin", 1, filename, sizeof(filename)))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       printf("PASS (%s)\n", filename);
     else
     {
index ea8f9d78ce0048d353d74985d3d4edca04a1baf0..2ef2496ebc8e353f7ccf6e756dd931b601dcb626 100644 (file)
 #include "file.h"
 #include "string-private.h"
 #include "ipp-private.h"
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
 #  include <fcntl.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index c7187c212d458df9369f9cd8102f1b785dd3cda1..a127a7947e032be6028420889e54c3edf9942fa0 100644 (file)
 #include "cups-private.h"
 #include "ppd-private.h"
 #include <sys/stat.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
 #  include <fcntl.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #include <math.h>
 
 
index 79d2438679939b3352a186384d4fb44ef52cbbd4..ae8163d1c10d82fc2d9e400ad1c59d37166de3b0 100644 (file)
@@ -46,7 +46,7 @@ typedef pthread_key_t _cups_threadkey_t;
 #    define _cupsThreadGetData(k) pthread_getspecific(k)
 #    define _cupsThreadSetData(k,p) pthread_setspecific(k,p)
 
-#  elif defined(WIN32)                 /* Windows threading */
+#  elif defined(_WIN32)                        /* Windows threading */
 #    include <winsock2.h>
 #    include <windows.h>
 typedef void *(__stdcall *_cups_thread_func_t)(void *arg);
index b59918b39e5c515a8ca1ea15878e525730e2cc40..7ffc2ec0732aa1a858abdc322cadc0b97bbeadb4 100644 (file)
@@ -208,7 +208,7 @@ _cupsThreadWait(_cups_thread_t thread)      /* I - Thread ID */
 }
 
 
-#elif defined(WIN32)
+#elif defined(_WIN32)
 #  include <process.h>
 
 
index f3dd092c42a1f8e522e290c1bb380d9279bd624c..2539a090a097cee2b8ae9b17d8d53b3ccbde4ef7 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <math.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <tchar.h>
 #else
 #  include <signal.h>
 #  include <sys/time.h>
 #  include <sys/resource.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
index 99601e4c44fadae5159fa4119bbea81a836a025a..781f27bbe2043fc18c92145091aa696af444423f 100644 (file)
 #include "cups-private.h"
 #include <stdlib.h>
 #include <sys/stat.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 #else
 #  include <pwd.h>
 #  include <termios.h>
 #  include <sys/utsname.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -490,12 +490,12 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@
 {
   _cups_globals_t      *cg = _cupsGlobals();
                                        /* Thread globals */
-#ifdef WIN32
+#ifdef _WIN32
   SYSTEM_INFO          sysinfo;        /* System information */
   OSVERSIONINFO                version;        /* OS version info */
 #else
   struct utsname       name;           /* uname info */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
   if (user_agent)
@@ -504,7 +504,7 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@
     return;
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
   GetVersionEx(&version);
   GetNativeSystemInfo(&sysinfo);
@@ -528,7 +528,7 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@
   snprintf(cg->user_agent, sizeof(cg->user_agent),
            CUPS_MINIMAL " (%s %s; %s) IPP/2.0",
           name.sysname, name.release, name.machine);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -580,7 +580,7 @@ cupsUserAgent(void)
 const char *                           /* O - Password or @code NULL@ if none */
 _cupsGetPassword(const char *prompt)   /* I - Prompt string */
 {
-#ifdef WIN32
+#ifdef _WIN32
   HANDLE               tty;            /* Console handle */
   DWORD                        mode;           /* Console mode */
   char                 passch,         /* Current key press */
@@ -846,7 +846,7 @@ _cupsGetPassword(const char *prompt)        /* I - Prompt string */
     memset(cg->password, 0, sizeof(cg->password));
     return (NULL);
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -905,7 +905,7 @@ _cupsSetDefaults(void)
 
 #  ifdef HAVE_GETEUID
   if ((geteuid() == getuid() || !getuid()) && getegid() == getgid() && (home = getenv("HOME")) != NULL)
-#  elif !defined(WIN32)
+#  elif !defined(_WIN32)
   if (getuid() && (home = getenv("HOME")) != NULL)
 #  else
   if ((home = getenv("HOME")) != NULL)
@@ -1101,7 +1101,7 @@ cups_finalize_client_conf(
 
   if (!cc->user[0])
   {
-#ifdef WIN32
+#ifdef _WIN32
    /*
     * Get the current user name from the OS...
     */
@@ -1137,7 +1137,7 @@ cups_finalize_client_conf(
     if (pw)
       strlcpy(cc->user, pw->pw_name, sizeof(cc->user));
     else
-#endif /* WIN32 */
+#endif /* _WIN32 */
     {
      /*
       * Use the default "unknown" user name...
index e800449ca882d19fe334c719a8eb6d88510a581d..ef1709c57d7db2879351491bee1750e6787986e2 100644 (file)
 #include "cups-private.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 
 
 /*
index edb650dfccc6e56209d3733c2edb52d634424055..3ff03008531d00fc0a97d3429aaa3d646b7f2810 100644 (file)
@@ -2132,11 +2132,11 @@ cups_read_fd(void          *ctx,        /* I - File descriptor as pointer */
   ssize_t      count;                  /* Number of bytes read */
 
 
-#ifdef WIN32 /* Sigh */
+#ifdef _WIN32 /* Sigh */
   while ((count = read(fd, buf, (unsigned)bytes)) < 0)
 #else
   while ((count = read(fd, buf, bytes)) < 0)
-#endif /* WIN32 */
+#endif /* _WIN32 */
     if (errno != EINTR && errno != EAGAIN)
     {
       DEBUG_printf(("8cups_read_fd: %s", strerror(errno)));
@@ -2213,11 +2213,11 @@ cups_write_fd(void          *ctx,       /* I - File descriptor pointer */
   ssize_t      count;                  /* Number of bytes written */
 
 
-#ifdef WIN32 /* Sigh */
+#ifdef _WIN32 /* Sigh */
   while ((count = write(fd, buf, (unsigned)bytes)) < 0)
 #else
   while ((count = write(fd, buf, bytes)) < 0)
-#endif /* WIN32 */
+#endif /* _WIN32 */
     if (errno != EINTR && errno != EAGAIN)
     {
       DEBUG_printf(("8cups_write_fd: %s", strerror(errno)));
index aa2542c56634ea0324c587d415c0ed4f0173d720..5add81002f6943cd1513a019e2b5875c2d5a6808 100644 (file)
@@ -23,9 +23,9 @@
 #include "data/epson.h"
 #include "data/hp.h"
 #include "data/label.h"
-#ifndef WIN32
+#ifndef _WIN32
 #  include <sys/utsname.h>
-#endif // !WIN32
+#endif // !_WIN32
 
 
 //
@@ -73,7 +73,7 @@ ppdcSource::ppdcSource(const char  *f,        // I - File to read
   vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
   vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
 
-#ifdef WIN32
+#ifdef _WIN32
   vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
   vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
 
@@ -90,7 +90,7 @@ ppdcSource::ppdcSource(const char  *f,        // I - File to read
     vars->add(new ppdcVariable("PLATFORM_NAME", "unknown"));
     vars->add(new ppdcVariable("PLATFORM_ARCH", "unknown"));
   }
-#endif // WIN32
+#endif // _WIN32
 
   if (f)
     read_file(f, ffp);
index ad37bee436624bc1ea748257454e29691de30ef4..08e1abebd883b32bdb81f12a5713287f36f6be30 100644 (file)
 #include <sys/stat.h>
 #include <sys/wait.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <direct.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #include "mime.h"
 
index d1b0a415bb0cc387019c86874928094a5e6f3f0a..3ff1951cd9b5b754487ce5c2a69fc0a7fd7f2748 100644 (file)
@@ -1087,7 +1087,7 @@ mime_check_rules(
          break;
 
       case MIME_MAGIC_LOCALE :
-#if defined(WIN32) || defined(__EMX__) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__EMX__) || defined(__APPLE__)
           result = !strcmp(rules->value.localev, setlocale(LC_ALL, ""));
 #else
           result = !strcmp(rules->value.localev, setlocale(LC_MESSAGES, ""));
index 9344c51eedc6d10c4fc2a3fa10c81986fcdb571c..d9a2f74ef92f4614e19f56cf8b1ca09d1abb5b7f 100644 (file)
@@ -24,9 +24,9 @@
 #include <cups/ppd-private.h>
 #include <cups/raster.h>
 #include <math.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  define X_OK 0
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index 2c938733ea3e62fd5634b30255c5d939793b36c4..8687d053fb2778415e76bbd85e9109b1e9bb0b5a 100644 (file)
 
 #define _CUPS_NO_DEPRECATED
 #include <cups/cups-private.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <process.h>
 #  include <sys/timeb.h>
 #else
 #  include <sys/wait.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #include <regex.h>
 #ifdef HAVE_DNSSD
 #  include <dns_sd.h>
@@ -39,9 +39,9 @@
 #  define kDNSServiceMaxDomainName AVAHI_DOMAIN_NAME_MAX
 #endif /* HAVE_DNSSD */
 
-#ifndef WIN32
+#ifndef _WIN32
 extern char **environ;                 /* Process environment variables */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
 /*
@@ -1766,10 +1766,10 @@ dnssd_error_string(int error)           /* I - Error number */
     case kDNSServiceErr_PollingMode :
         return ("Service polling mode error.");
 
-#ifndef WIN32
+#ifndef _WIN32
     case kDNSServiceErr_Timeout :
         return ("Service timeout.");
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   }
 
 #  elif defined(HAVE_AVAHI)
@@ -1920,10 +1920,10 @@ exec_program(ippfind_srv_t *service,    /* I - Service */
   int          i,                      /* Looping var */
                myenvc,                 /* Number of environment variables */
                status;                 /* Exit status of program */
-#ifndef WIN32
+#ifndef _WIN32
   char         program[1024];          /* Program to execute */
   int          pid;                    /* Process ID */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
  /*
@@ -2058,7 +2058,7 @@ exec_program(ippfind_srv_t *service,      /* I - Service */
       myargv[i] = strdup(args[i]);
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   if (getenv("IPPFIND_DEBUG"))
   {
     printf("\nProgram:\n    %s\n", args[0]);
@@ -2121,7 +2121,7 @@ exec_program(ippfind_srv_t *service,      /* I - Service */
     while (wait(&status) != pid)
       ;
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
  /*
   * Free memory...
@@ -2139,14 +2139,14 @@ exec_program(ippfind_srv_t *service,    /* I - Service */
 
   if (getenv("IPPFIND_DEBUG"))
   {
-#ifdef WIN32
+#ifdef _WIN32
     printf("Exit Status: %d\n", status);
 #else
     if (WIFEXITED(status))
       printf("Exit Status: %d\n", WEXITSTATUS(status));
     else
       printf("Terminating Signal: %d\n", WTERMSIG(status));
-#endif /* WIN32 */
+#endif /* _WIN32 */
   }
 
   return (status == 0);
@@ -2220,7 +2220,7 @@ get_service(cups_array_t *services,       /* I - Service array */
 static double
 get_time(void)
 {
-#ifdef WIN32
+#ifdef _WIN32
   struct _timeb curtime;               /* Current Windows time */
 
   _ftime(&curtime);
@@ -2234,7 +2234,7 @@ get_time(void)
     return (0.0);
   else
     return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
index 38b304f80866206f5c05031ffa4f6a8faac0e314..c35c5e6abde9f44fa8bc4d16efaa2bbf4296310e 100644 (file)
@@ -37,7 +37,7 @@
 #include <limits.h>
 #include <sys/stat.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <fcntl.h>
 #  include <io.h>
 #  include <process.h>
@@ -51,7 +51,7 @@ extern char **environ;
 #  include <sys/fcntl.h>
 #  include <sys/wait.h>
 #  include <poll.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #ifdef HAVE_DNSSD
 #  include <dns_sd.h>
@@ -652,7 +652,7 @@ main(int  argc,                             /* I - Number of command-line args */
 
   if (!port)
   {
-#ifdef WIN32
+#ifdef _WIN32
    /*
     * Windows is almost always used as a single user system, so use a default
     * port number of 8631.
@@ -666,7 +666,7 @@ main(int  argc,                             /* I - Number of command-line args */
     */
 
     port = 8000 + ((int)getuid() % 1000);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     fprintf(stderr, "Listening on port %d.\n", port);
   }
@@ -675,7 +675,7 @@ main(int  argc,                             /* I - Number of command-line args */
   {
     const char *tmpdir;                        /* Temporary directory */
 
-#ifdef WIN32
+#ifdef _WIN32
     if ((tmpdir = getenv("TEMP")) == NULL)
       tmpdir = "C:/TEMP";
 #elif defined(__APPLE__) && !TARGET_OS_IOS
@@ -684,7 +684,7 @@ main(int  argc,                             /* I - Number of command-line args */
 #else
     if ((tmpdir = getenv("TMPDIR")) == NULL)
       tmpdir = "/tmp";
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     snprintf(directory, sizeof(directory), "%s/ippserver.%d", tmpdir, (int)getpid());
 
@@ -1280,9 +1280,9 @@ create_printer(const char *servername,    /* I - Server hostname (NULL for default)
 {
   int                  i, j;           /* Looping vars */
   _ipp_printer_t       *printer;       /* Printer */
-#ifndef WIN32
+#ifndef _WIN32
   char                 path[1024];     /* Full path to command */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   char                 uri[1024],      /* Printer URI */
 #ifdef HAVE_SSL
                        securi[1024],   /* Secure printer URI */
@@ -1484,7 +1484,7 @@ create_printer(const char *servername,    /* I - Server hostname (NULL for default)
   };
 
 
-#ifndef WIN32
+#ifndef _WIN32
  /*
   * If a command was specified, make sure it exists and is executable...
   */
@@ -1510,7 +1510,7 @@ create_printer(const char *servername,    /* I - Server hostname (NULL for default)
       command = path;
     }
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Allocate memory for the printer...
@@ -2481,9 +2481,9 @@ filter_cb(_ipp_filter_t   *filter,        /* I - Filter parameters */
   * Filter attributes as needed...
   */
 
-#ifndef WIN32 /* Avoid MS compiler bug */
+#ifndef _WIN32 /* Avoid MS compiler bug */
   (void)dst;
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
   ipp_tag_t group = ippGetGroupTag(attr);
   const char *name = ippGetName(attr);
@@ -6032,13 +6032,13 @@ process_job(_ipp_job_t *job)            /* I - Job */
     ipp_attribute_t *attr;             /* Job attribute */
     char       val[1280],              /* IPP_NAME=value */
                *valptr;                /* Pointer into string */
-#ifndef WIN32
+#ifndef _WIN32
     int                mypipe[2];              /* Pipe for stderr */
     char       line[2048],             /* Line from stderr */
                *ptr,                   /* Pointer into line */
                *endptr;                /* End of line */
     ssize_t    bytes;                  /* Bytes read */
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
     fprintf(stderr, "Running command \"%s %s\".\n", job->printer->command,
             job->filename);
@@ -6096,7 +6096,7 @@ process_job(_ipp_job_t *job)              /* I - Job */
     * Now run the program...
     */
 
-#ifdef WIN32
+#ifdef _WIN32
     status = _spawnvpe(_P_WAIT, job->printer->command, myargv, myenvp);
 
 #else
@@ -6206,20 +6206,20 @@ process_job(_ipp_job_t *job)            /* I - Job */
       while (wait(&status) < 0);
 #  endif /* HAVE_WAITPID */
     }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
     if (status)
     {
-#ifndef WIN32
+#ifndef _WIN32
       if (WIFEXITED(status))
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
        fprintf(stderr, "Command \"%s\" exited with status %d.\n",
                job->printer->command, WEXITSTATUS(status));
-#ifndef WIN32
+#ifndef _WIN32
       else
        fprintf(stderr, "Command \"%s\" terminated with signal %d.\n",
                job->printer->command, WTERMSIG(status));
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
       job->state = IPP_JSTATE_ABORTED;
     }
     else if (status < 0)
index 9c57ca2b9a48cd1d73a8bb16654cfa9a4b388341..4cea4df0b9fe2f6d153ab48d79d4855a2f8d8126 100644 (file)
@@ -21,7 +21,7 @@
 #include <cups/file-private.h>
 #include <regex.h>
 #include <sys/stat.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 #  ifndef R_OK
 #    define R_OK 0
@@ -29,7 +29,7 @@
 #else
 #  include <signal.h>
 #  include <termios.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #ifndef O_BINARY
 #  define O_BINARY 0
 #endif /* !O_BINARY */
@@ -174,9 +174,9 @@ static void print_xml_header(cups_file_t *outfile);
 static void    print_xml_string(cups_file_t *outfile, const char *element, const char *s);
 static void    print_xml_trailer(cups_file_t *outfile, int success, const char *message);
 static void    set_variable(cups_file_t *outfile, _cups_vars_t *vars, const char *name, const char *value);
-#ifndef WIN32
+#ifndef _WIN32
 static void    sigterm_handler(int sig);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 static int     timeout_cb(http_t *http, void *user_data);
 static void    usage(void) __attribute__((noreturn));
 static int     validate_attr(cups_file_t *outfile, cups_array_t *errors, ipp_attribute_t *attr);
@@ -213,14 +213,14 @@ main(int  argc,                           /* I - Number of command-line args */
                                        /* Global data */
 
 
-#ifndef WIN32
+#ifndef _WIN32
  /*
   * Catch SIGINT and SIGTERM...
   */
 
   signal(SIGINT, sigterm_handler);
   signal(SIGTERM, sigterm_handler);
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Initialize the locale and variables...
@@ -432,9 +432,9 @@ main(int  argc,                             /* I - Number of command-line args */
 
                snprintf(filename, sizeof(filename), "%s.gz", argv[i]);
                 if (access(filename, 0) && filename[0] != '/'
-#ifdef WIN32
+#ifdef _WIN32
                     && (!isalpha(filename[0] & 255) || filename[1] != ':')
-#endif /* WIN32 */
+#endif /* _WIN32 */
                     )
                {
                  snprintf(filename, sizeof(filename), "%s/ipptool/%s",
@@ -650,9 +650,9 @@ main(int  argc,                             /* I - Number of command-line args */
       }
 
       if (access(argv[i], 0) && argv[i][0] != '/'
-#ifdef WIN32
+#ifdef _WIN32
           && (!isalpha(argv[i][0] & 255) || argv[i][1] != ':')
-#endif /* WIN32 */
+#endif /* _WIN32 */
           )
       {
         snprintf(testname, sizeof(testname), "%s/ipptool/%s", cg->cups_datadir,
@@ -2757,11 +2757,11 @@ do_tests(cups_file_t  *outfile,         /* I - Output file */
          }
 
          if (!Cancel && status == HTTP_STATUS_ERROR && http->error != EINVAL &&
-#ifdef WIN32
+#ifdef _WIN32
              http->error != WSAETIMEDOUT)
 #else
              http->error != ETIMEDOUT)
-#endif /* WIN32 */
+#endif /* _WIN32 */
          {
            if (httpReconnect2(http, 30000, NULL))
              prev_pass = 0;
@@ -2784,11 +2784,11 @@ do_tests(cups_file_t  *outfile,         /* I - Output file */
       }
 
       if (!Cancel && status == HTTP_STATUS_ERROR && http->error != EINVAL &&
-#ifdef WIN32
+#ifdef _WIN32
          http->error != WSAETIMEDOUT)
 #else
          http->error != ETIMEDOUT)
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
        if (httpReconnect2(http, 30000, NULL))
          prev_pass = 0;
@@ -4056,9 +4056,9 @@ get_filename(const char *testfile,        /* I - Current test file */
       *dstptr = '\0';
   }
   else if (*src == '/' || !strchr(testfile, '/')
-#ifdef WIN32
+#ifdef _WIN32
            || (isalpha(*src & 255) && src[1] == ':')
-#endif /* WIN32 */
+#endif /* _WIN32 */
            )
   {
    /*
@@ -4353,7 +4353,7 @@ password_cb(const char *prompt)           /* I - Prompt (unused) */
 static void
 pause_message(const char *message)     /* I - Message */
 {
-#ifdef WIN32
+#ifdef _WIN32
   HANDLE       tty;                    /* Console handle */
   DWORD                mode;                   /* Console mode */
   char         key;                    /* Key press */
@@ -4401,7 +4401,7 @@ pause_message(const char *message)        /* I - Message */
     close(tty);
     return;
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
  /*
   * Display the prompt...
@@ -4409,7 +4409,7 @@ pause_message(const char *message)        /* I - Message */
 
   cupsFilePrintf(cupsFileStdout(), "%s\n---- PRESS ANY KEY ----", message);
 
-#ifdef WIN32
+#ifdef _WIN32
  /*
   * Read a key...
   */
@@ -4435,7 +4435,7 @@ pause_message(const char *message)        /* I - Message */
 
   tcsetattr(tty, TCSAFLUSH, &original);
   close(tty);
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
  /*
   * Erase the "press any key" prompt...
@@ -4997,7 +4997,7 @@ set_variable(cups_file_t  *outfile,       /* I - Output file */
 }
 
 
-#ifndef WIN32
+#ifndef _WIN32
 /*
  * 'sigterm_handler()' - Handle SIGINT and SIGTERM.
  */
@@ -5012,7 +5012,7 @@ sigterm_handler(int sig)          /* I - Signal number (unused) */
   signal(SIGINT, SIG_DFL);
   signal(SIGTERM, SIG_DFL);
 }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
 /*
index 8e0694608a94140edcc456d0a837510c813efe20..7f2a9de584f49fe1051801dfc45b016d0148efd5 100644 (file)
@@ -52,8 +52,8 @@
 
 
 /*
- * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32 stricmp()
- * and strnicmp() functions...
+ * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
+ * _stricmp() and _strnicmp() functions...
  */
 
 #define strcasecmp     _stricmp
@@ -94,8 +94,8 @@ typedef unsigned long useconds_t;
  * Version of software...
  */
 
-#define CUPS_SVERSION "CUPS v2.2.8"
-#define CUPS_MINIMAL "CUPS/2.2.8"
+#define CUPS_SVERSION "CUPS v2.2.9"
+#define CUPS_MINIMAL "CUPS/2.2.9"
 
 
 /*