*: check defined(_WIN32) instead of defined(WIN32)

Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
This commit is contained in:
Max Kellermann
2017-12-12 10:22:20 +01:00
parent d9552d8a6d
commit dfaf08743c
91 changed files with 226 additions and 225 deletions

View File

@@ -23,7 +23,7 @@
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#ifndef WIN32
#ifndef _WIN32
#include "PidFile.hxx"
#endif
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <fcntl.h>
#ifndef WIN32
#ifndef _WIN32
#include <sys/wait.h>
#include <signal.h>
#include <pwd.h>
@@ -42,7 +42,7 @@
#define WCOREDUMP(v) 0
#endif
#ifndef WIN32
#ifndef _WIN32
/** the Unix user name which MPD runs as */
static char *user_name;

View File

@@ -22,7 +22,7 @@
class AllocatedPath;
#ifndef WIN32
#ifndef _WIN32
void
daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile);
#else
@@ -31,7 +31,7 @@ daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile)
{ (void)user; (void)group; (void)pidfile; }
#endif
#ifndef WIN32
#ifndef _WIN32
void
daemonize_finish();
#else
@@ -44,7 +44,7 @@ daemonize_finish()
* Kill the MPD which is currently running, pid determined from the
* pid file.
*/
#ifndef WIN32
#ifndef _WIN32
void
daemonize_kill();
#else
@@ -59,7 +59,7 @@ daemonize_kill()
/**
* Close stdin (fd 0) and re-open it as /dev/null.
*/
#ifndef WIN32
#ifndef _WIN32
void
daemonize_close_stdin();
#else
@@ -70,7 +70,7 @@ daemonize_close_stdin() {}
/**
* Change to the configured Unix user.
*/
#ifndef WIN32
#ifndef _WIN32
void
daemonize_set_user();
#else
@@ -79,7 +79,7 @@ daemonize_set_user()
{ /* nop */ }
#endif
#ifndef WIN32
#ifndef _WIN32
void
daemonize_begin(bool detach);
#else
@@ -88,7 +88,7 @@ daemonize_begin(bool detach)
{ (void)detach; }
#endif
#ifndef WIN32
#ifndef _WIN32
void
daemonize_commit();
#else

View File

@@ -21,7 +21,7 @@
#include "SignalHandlers.hxx"
#include "event/SignalMonitor.hxx"
#ifndef WIN32
#ifndef _WIN32
#include "Log.hxx"
#include "LogInit.hxx"
@@ -61,7 +61,7 @@ SignalHandlersInit(EventLoop &loop)
{
SignalMonitorInit(loop);
#ifndef WIN32
#ifndef _WIN32
struct sigaction sa;
sa.sa_flags = 0;