]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Migrate Windows conditional code to _WIN32 define.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 10 Oct 2018 04:17:22 +0000 (00:17 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 10 Oct 2018 04:17:22 +0000 (00:17 -0400)
41 files changed:
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/raster.c
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
cups/versioning.h

index b86d1977b6b381d3f741d587b04c9318f9cff253..8970a06accd7e1c5b3106a683c14f80784a994a8 100644 (file)
 #include "adminutil.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#ifdef WIN32
-#else
+#ifndef _WIN32
 #  include <unistd.h>
 #  include <sys/wait.h>
-#endif /* WIN32 */
+#endif /* !_WIN32 */
 
 
 /*
@@ -2081,7 +2080,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
@@ -2148,7 +2147,7 @@ do_samba_command(const char *command,     /* I - Command to run */
     return (WEXITSTATUS(status));
   else
     return (-WTERMSIG(status));
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -2166,9 +2165,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 */
 
@@ -2185,7 +2184,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))
   {
    /*
@@ -2212,7 +2211,7 @@ get_cupsd_conf(
       status = HTTP_STATUS_OK;
   }
   else
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
   {
    /*
     * Read cupsd.conf via a HTTP GET request...
index 47e14168e4be74655e6fb04529f700d706860bd8..499950d22d02b10b9e109a5d3d98c80d5b41b980 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>
@@ -895,9 +895,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);
@@ -1098,5 +1098,5 @@ cups_local_auth(http_t *http)             /* I - HTTP connection to server */
   }
 
   return (1);
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 }
index f9babfd9392ab962a11f6532c840553d558c250a..6c9aba417020465916f59b543ad673b191e400d5 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 */
 
 
 /*
@@ -71,11 +71,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 */
 }
 
 
@@ -133,11 +133,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 59c8306b14978c26518759ef18d27ca23ca60936..69a00d14ef0abdb806680aa598edb37d765f2ece 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 eccebcd2bf34b477a485d5b4f6e646000c7b8a3e..0bde41b3b83cb3d047b8bed28eb09cd6612a538d 100644 (file)
@@ -82,10 +82,10 @@ extern int  _cups_debug_level _CUPS_PRIVATE;
 extern void    _cups_debug_printf(const char *format, ...) _CUPS_FORMAT(1,2) _CUPS_PUBLIC;
 extern void    _cups_debug_puts(const char *s) _CUPS_PUBLIC;
 extern void    _cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PUBLIC;
-#  ifdef WIN32
+#  ifdef _WIN32
 extern int     _cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
 #    define gettimeofday(a,b) _cups_gettimeofday(a, b)
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 #  ifdef __cplusplus
 }
index a52fbd1031e713490935a39a0a01467983a6d38c..b04432b5e3628159e4f3e9f56528c26bd13e5184 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "cups-private.h"
 #include "thread-private.h"
-#ifdef WIN32
+#ifdef _WIN32
 #  include <sys/timeb.h>
 #  include <time.h>
 #  include <io.h>
@@ -30,7 +30,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 55f6602c73c708d2c7c609326dd449a67f3b637f..951ebf120f55289adcf7bc3082f295d5011143f1 100644 (file)
@@ -2031,9 +2031,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 */
@@ -2067,7 +2067,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())
   {
    /*
@@ -2087,7 +2087,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...
@@ -2099,7 +2099,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...
@@ -2107,7 +2107,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 999ace2f8f9ba210766c152b43f7d8b001b78ec6..89e354ad16c5a39c14d34ffa64ea46289dd6d610 100644 (file)
@@ -22,7 +22,7 @@
  * Windows implementation...
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 
 /*
@@ -418,4 +418,4 @@ cupsDirRewind(cups_dir_t *dp)               /* I - Directory pointer */
 
   rewinddir(dp->dir);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
index 2a509fae937f42abc4b7c130b33b14e376a823de..dff3ed99199dc4c7a55b6fcda82e65d7baa2e4d3 100644 (file)
 #  ifdef HAVE_LIBZ
 #    include <zlib.h>
 #  endif /* HAVE_LIBZ */
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #    include <sys/locking.h>
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 
 /*
index aa462ebafff50123d0f65a253040427f1736d0d6..5356d5ce67f10b726988fd09c2085bb617e9c000 100644 (file)
@@ -34,7 +34,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.
  */
@@ -300,7 +300,7 @@ _cupsFileCheckFilter(
 
   fprintf(stderr, "%s: %s\n", prefix, message);
 }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
 
 /*
@@ -520,22 +520,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);
@@ -986,11 +986,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 */
 }
 
 
@@ -1078,11 +1078,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 */
@@ -1249,9 +1249,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);
 }
@@ -2013,11 +2013,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 */
 }
 
 
@@ -2547,9 +2547,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 */
 
 
  /*
@@ -2577,18 +2577,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...
   */
@@ -2616,7 +2616,7 @@ cups_open(const char *filename,           /* I - Filename */
     errno = EPERM;
     return (-1);
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
   return (fd);
 }
@@ -2642,7 +2642,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
@@ -2652,7 +2652,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));
 
@@ -2699,7 +2699,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
@@ -2709,7 +2709,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 43137b1fc07d8ee47c8c1c93e640b8a19c3e90a1..49ca58a0c4e585ecf7dc151af9212fcc4cceca7c 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 2cdb9cb0999440f7c260aec009b890aa30607e4d..4e958931576e3785502c4524326696bc0296b724 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 e91d77900f20d25431775bbef6492b451d12c5c8..d67c752ce6f54bf652ab7f17dd32d21b980dd397 100644 (file)
@@ -28,23 +28,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 */
@@ -59,7 +59,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 */
 }
@@ -114,13 +114,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.
  */
@@ -164,7 +164,7 @@ DllMain(HINSTANCE hinst,            /* I - DLL module handle */
 
   return (TRUE);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -176,13 +176,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)
@@ -213,7 +213,7 @@ cups_globals_alloc(void)
   * Then set directories as appropriate...
   */
 
-#ifdef WIN32
+#ifdef _WIN32
   if (!installdir[0])
   {
    /*
@@ -309,7 +309,7 @@ cups_globals_alloc(void)
     if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
       cg->localedir = CUPS_LOCALEDIR;
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
   return (cg);
 }
@@ -319,7 +319,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 */
 {
@@ -354,7 +354,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 fc945989598760d20b38add8da6c16b2f73d67b8..e4deed34edc243ceb2f23ae056da2cc46d3203c0 100644 (file)
@@ -63,11 +63,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
@@ -252,9 +252,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 688901a7dd643464b0eb5b44cb2a47ff670598ef..23031f50aecbd61c515e6e7d4ca9a02a6b93363d 100644 (file)
@@ -19,9 +19,9 @@
 #ifdef HAVE_POLL
 #  include <poll.h>
 #endif /* HAVE_POLL */
-#ifndef WIN32
+#ifndef _WIN32
 #  include <fcntl.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -56,9 +56,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 */
@@ -208,11 +208,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]);
@@ -220,9 +220,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)
@@ -291,11 +291,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)
     {
@@ -372,11 +372,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);
 }
@@ -844,11 +844,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 b486e38558189cec68e563f717786d7a08369ed3..b228ea72e0986e5be16e5d0076161fd4a2cf4b8e 100644 (file)
@@ -25,7 +25,7 @@
 #  endif /* __sun */
 
 #  include <limits.h>
-#  ifdef WIN32
+#  ifdef _WIN32
 #    include <io.h>
 #    include <winsock2.h>
 #    define CUPS_SOCAST (const char *)
@@ -34,7 +34,7 @@
 #    include <fcntl.h>
 #    include <sys/socket.h>
 #    define CUPS_SOCAST
-#  endif /* WIN32 */
+#  endif /* _WIN32 */
 
 #  ifdef HAVE_GSSAPI
 #    ifdef HAVE_GSS_GSSAPI_H
@@ -88,7 +88,7 @@ typedef int socklen_t;
 #    include <sspi.h>
 #  endif /* HAVE_GNUTLS */
 
-#  ifndef WIN32
+#  ifndef _WIN32
 #    include <net/if.h>
 #    include <resolv.h>
 #    ifdef HAVE_GETIFADDRS
@@ -99,7 +99,7 @@ typedef int socklen_t;
 #        include <sys/sockio.h>
 #      endif /* HAVE_SYS_SOCKIO_H */
 #    endif /* HAVE_GETIFADDRS */
-#  endif /* !WIN32 */
+#  endif /* !_WIN32 */
 
 #  ifdef HAVE_LIBZ
 #    include <zlib.h>
@@ -338,7 +338,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 */
@@ -373,7 +373,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 3834dbef8470bab2d04716fa7a2ef245c223f4a4..364939bcc48b57ee64f6f0d1e79819ed3c88d3c5 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>
@@ -1763,9 +1763,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 */
@@ -1894,11 +1894,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 56546a6c4c4203355c7066f9cabb9a1b6590face..794a213b2f030de9a386f65a0e72781ff16d30d4 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 */
@@ -1145,11 +1145,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)
     {
@@ -1163,11 +1163,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);
       }
 
@@ -1181,7 +1181,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)
@@ -1218,7 +1218,7 @@ httpGets(char   *line,                    /* I - Line to read into */
          http->error = errno;
          continue;
        }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
         return (NULL);
       }
@@ -1485,9 +1485,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();
@@ -1497,7 +1497,7 @@ httpInitialize(void)
     return;
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   WSAStartup(MAKEWORD(2,2), &winsockdata);
 
 #elif !defined(SO_NOSIGPIPE)
@@ -1519,7 +1519,7 @@ httpInitialize(void)
 #  else
   signal(SIGPIPE, SIG_IGN);
 #  endif /* !SO_NOSIGPIPE */
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #  ifdef HAVE_SSL
   _httpTLSInitialize();
@@ -1807,7 +1807,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
 
   if (bytes < 0)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK)
       bytes = 0;
     else
@@ -1817,7 +1817,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
       bytes = 0;
     else
       http->error = errno;
-#endif /* WIN32 */
+#endif /* _WIN32 */
   }
   else if (bytes == 0)
   {
@@ -2378,11 +2378,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",
@@ -2695,11 +2695,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 */
 }
 
 
@@ -3033,12 +3033,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,
@@ -4058,7 +4058,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
 
     if (bytes < 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       if (WSAGetLastError() != WSAEINTR)
       {
        http->error = WSAGetLastError();
@@ -4094,7 +4094,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
        http->error = errno;
        return (-1);
       }
-#endif /* WIN32 */
+#endif /* _WIN32 */
     }
   }
   while (bytes < 0);
@@ -4108,7 +4108,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
 
   if (bytes < 0)
   {
-#ifdef WIN32
+#ifdef _WIN32
     if (WSAGetLastError() == WSAEINTR)
       bytes = 0;
     else
@@ -4118,7 +4118,7 @@ http_read(http_t *http,                   /* I - HTTP connection */
       bytes = 0;
     else
       http->error = errno;
-#endif /* WIN32 */
+#endif /* _WIN32 */
   }
   else if (bytes == 0)
   {
@@ -4480,7 +4480,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 */
 
@@ -4495,7 +4495,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 */
 }
 
 
@@ -4663,12 +4663,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)
@@ -4678,11 +4678,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);
        }
       }
@@ -4701,7 +4701,7 @@ http_write(http_t     *http,              /* I - HTTP connection */
 
     if (bytes < 0)
     {
-#ifdef WIN32
+#ifdef _WIN32
       if (WSAGetLastError() == WSAEINTR)
         continue;
       else if (WSAGetLastError() == WSAEWOULDBLOCK)
@@ -4735,7 +4735,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 67373e510c248797547214f940a7c9134ec1fb45..01a0321dfa068a3396f479f1039e8bc83b949f74 100644 (file)
@@ -20,7 +20,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... */
@@ -49,7 +49,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 */
 
 
 /*
@@ -80,7 +80,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 afd85474d6bc0555d171560ad3c041790559624e..06fdc69b364fa49a7edd03acd6f1ca96e0f91677 100644 (file)
@@ -14,9 +14,9 @@
 
 #include "cups-private.h"
 #include <regex.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
@@ -6641,14 +6641,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;
@@ -6676,11 +6676,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 */
 }
 
 
@@ -6850,9 +6850,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 78d7d1573d4e7302400acb7c6b0eaf2d2bd0c3e0..7c848c09cf5f62398c8d83969a316be164aa8af1 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 ab3ab244d801d63d6e59f5eb75559f474b68ea25..d2b58520c258746665eb684a8508413f6b64cccd 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__ */
 
 
 /*
@@ -323,11 +323,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 294d83927d1fa6975179382f02b4e9888e19675a..cdc29d34ad988bc169f4b019804edc6cd2d9fce7 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__ */
 
 
 /*
@@ -169,7 +169,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...
   */
@@ -309,7 +309,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 e47a5727bd3999c304b06282dda60261b705fd11..3ca30fba65709efc426481a2710c3c0bd69708b3 100644 (file)
@@ -82,9 +82,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 */
@@ -2825,13 +2825,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 a776714e03bf21ce6716241dc709c593f67ab1ec..9538f3998bb4d78c8a601f6754d4cfe352a79fe1 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 4efdc64ab0aab90a0026922bf4a2aae2269e0ebe..cfac0c5f72e9568dfb0ad60e3fe524f68399713c 100644 (file)
@@ -2131,11 +2131,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)));
@@ -2212,11 +2212,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 e58beceeba59044c4f069ee6545a8dc0460b3ce0..acf9cd307341d9aea183056edc559dc46545686d 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 */
@@ -150,11 +150,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...
@@ -166,11 +166,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
@@ -209,9 +209,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)
@@ -1022,13 +1022,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 a1648c46927698cee07f5a976c445701589847f6..c70df1e9eb13a8e320e7bfc43c7dbf669b6d0b78 100644 (file)
 
 #include "sidechannel.h"
 #include "cups-private.h"
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#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 1e1fa3eeffa880e7b499db0720b5e5b4d1b12e94..07c18c48fbedfa5bbee855483e0fccce57ef14dd 100644 (file)
@@ -390,11 +390,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 0b0f5fce49da40ae1b1cfb699c53175af0ba9753..6a0394663eb00faf8f3cfdcb110058f0ace116b5 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 bf26a08e8fae1fc3e66fd3d219219d190d5c84a8..e305c6cd9d8929ca695f274b60d4ca3e20524846 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__ */
 
 
 /*
@@ -37,21 +37,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);
@@ -87,7 +87,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...
@@ -97,7 +97,7 @@ cupsTempFd(char *filename,            /* I - Pointer to buffer */
 
   do
   {
-#ifdef WIN32
+#ifdef _WIN32
    /*
     * Get the current time of day...
     */
@@ -121,21 +121,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 d0dd1b3161bb299b1cc562d925e5d665b455bc87..185fcbec57c0a621a0176aee5eb7ccc367840f21 100644 (file)
@@ -487,7 +487,7 @@ main(void)
  * 'get_seconds()' - Get the current time in seconds...
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 
 
@@ -508,7 +508,7 @@ get_seconds(void)
   gettimeofday(&curtime, NULL);
   return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
index e0126f90d7119036b96d8cffd264f95c0e88a5b1..68d22abe8cf886a0404452727ace58b94cb8ff63 100644 (file)
 #ifdef HAVE_LIBZ
 #  include <zlib.h>
 #endif /* HAVE_LIBZ */
-#ifdef WIN32
+#ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 #include <fcntl.h>
 
 
@@ -47,10 +47,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 */
 
 
@@ -78,7 +78,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
     status += random_tests();
 
-#ifndef WIN32
+#ifndef _WIN32
    /*
     * Test fdopen and close without reading...
     */
@@ -112,7 +112,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
       puts("PASS");
     }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
    /*
     * Count lines in test file, rewind, then count again.
@@ -168,13 +168,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 6dd192da939229277f690773b5051b3a902c8fa8..3514b94d5d984b6b5d990761eb311ca918a6525e 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 0e3668f54af2f0b3849eb1a4edbefd6c49a661e8..3e4f29b03819b1f3a56b9200fa6a827d3e297b5e 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 08e669c8eb29278f790f700e51935677a1f99db8..69617b536adc84322b9b0d4f7bf318b17e1d79ed 100644 (file)
@@ -40,7 +40,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 717574ac7f962b8bda1b63ab9fd7751a5d652518..fcab9382676857751e56a42cf52ea87b6a0e4374 100644 (file)
@@ -203,7 +203,7 @@ _cupsThreadWait(_cups_thread_t thread)      /* I - Thread ID */
 }
 
 
-#elif defined(WIN32)
+#elif defined(_WIN32)
 #  include <process.h>
 
 
index 278439db2eaf5da302218ad4989c9544c3e2251a..916d32917d1d6a13b3120c4ae7ae44684de28e1e 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 c6c774e4aa3037f26689f1dad8fea2d669b686e3..3cf265646bca2062d85a46257c68aa25b488c48c 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 */
 
 
 /*
@@ -484,12 +484,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)
@@ -498,7 +498,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);
@@ -522,7 +522,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 */
 }
 
 
@@ -574,7 +574,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 */
@@ -840,7 +840,7 @@ _cupsGetPassword(const char *prompt)        /* I - Prompt string */
     memset(cg->password, 0, sizeof(cg->password));
     return (NULL);
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 }
 
 
@@ -899,7 +899,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)
@@ -1095,7 +1095,7 @@ cups_finalize_client_conf(
 
   if (!cc->user[0])
   {
-#ifdef WIN32
+#ifdef _WIN32
    /*
     * Get the current user name from the OS...
     */
@@ -1131,7 +1131,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 b15963e9ebe38353b53ab9a21b669256e4c08f1d..077c0e8857ce88f2c53e22286bff5286b89a87a9 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 037b7076ff79803481675fb63497f2b981623a35..d187a71cfeede1e10018be3b587ad1ad73dbb70d 100644 (file)
@@ -74,7 +74,7 @@
 #  ifdef _CUPS_HAS_VISIBILITY
 #    define _CUPS_PRIVATE      __attribute__ ((visibility("hidden")))
 #    define _CUPS_PUBLIC       __attribute__ ((visibility("default")))
-#  elif defined(WIN32) && defined(LIBCUPS2_EXPORTS)
+#  elif defined(_WIN32) && defined(LIBCUPS2_EXPORTS)
 #    define _CUPS_PRIVATE
 #    define _CUPS_PUBLIC       __declspec(dllexport)
 #  else