]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/ippserver.c
Migrate Windows conditional code to _WIN32 define.
[thirdparty/cups.git] / test / ippserver.c
index 8769094e8f206179db7821d069e76a2e18c67e81..f291b389ccdc4c30cde8d907741d8688eed6d892 100644 (file)
@@ -31,7 +31,7 @@
 #include <limits.h>
 #include <sys/stat.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <fcntl.h>
 #  include <io.h>
 #  include <process.h>
@@ -45,7 +45,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>
@@ -662,7 +662,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.
@@ -676,7 +676,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);
   }
@@ -685,7 +685,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
@@ -694,7 +694,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());
 
@@ -1290,9 +1290,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 */
@@ -1495,7 +1495,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...
   */
@@ -1521,7 +1521,7 @@ create_printer(const char *servername,    /* I - Server hostname (NULL for default)
       command = path;
     }
   }
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
 
  /*
   * Allocate memory for the printer...
@@ -2497,9 +2497,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);
@@ -6057,13 +6057,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);
@@ -6121,7 +6121,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
@@ -6231,20 +6231,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)