From bb12ff83564d43566089dd979639c6993ba76665 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Thu, 6 Jan 2011 00:51:33 +0100 Subject: Apply #ifdefs around functionality not available on win32 And also the reverse: around some win32 specific functionality --- src/daemon/daemon-conf.c | 5 +++++ src/daemon/dumpmodules.c | 2 ++ src/daemon/ltdl-bind-now.c | 4 ++++ src/daemon/main.c | 2 ++ 4 files changed, 13 insertions(+) (limited to 'src/daemon') diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 74e81351..3339f3b0 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -28,7 +28,10 @@ #include #include #include + +#ifdef HAVE_SCHED_H #include +#endif #include #include @@ -460,10 +463,12 @@ static int parse_rtprio(const char *filename, unsigned line, const char *section pa_assert(rvalue); pa_assert(data); +#ifdef HAVE_SCHED_H if (pa_atoi(rvalue, &rtprio) < 0 || rtprio < sched_get_priority_min(SCHED_FIFO) || rtprio > sched_get_priority_max(SCHED_FIFO)) { pa_log("[%s:%u] Invalid realtime priority '%s'.", filename, line, rvalue); return -1; } +#endif c->realtime_priority = (int) rtprio; return 0; diff --git a/src/daemon/dumpmodules.c b/src/daemon/dumpmodules.c index 92470b49..d0504dc5 100644 --- a/src/daemon/dumpmodules.c +++ b/src/daemon/dumpmodules.c @@ -90,7 +90,9 @@ static void show_info(const char *name, const char *path, void (*info)(const cha } } +#ifndef OS_IS_WIN32 extern const lt_dlsymlist lt_preloaded_symbols[]; +#endif static int is_preloaded(const char *name) { const lt_dlsymlist *l; diff --git a/src/daemon/ltdl-bind-now.c b/src/daemon/ltdl-bind-now.c index 276b2a06..2ba73ce7 100644 --- a/src/daemon/ltdl-bind-now.c +++ b/src/daemon/ltdl-bind-now.c @@ -51,6 +51,10 @@ #undef PA_BIND_NOW #endif +#ifdef OS_IS_WIN32 +#undef PA_BIND_NOW +#endif + #ifdef PA_BIND_NOW /* diff --git a/src/daemon/main.c b/src/daemon/main.c index cab275f3..5aeb9bc6 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -654,6 +654,7 @@ int main(int argc, char *argv[]) { goto finish; } +#ifdef HAVE_GETUID if (getuid() == 0 && !conf->system_instance) pa_log_warn(_("This program is not intended to be run as root (unless --system is specified).")); #ifndef HAVE_DBUS /* A similar, only a notice worthy check was done earlier, if D-Bus is enabled. */ @@ -662,6 +663,7 @@ int main(int argc, char *argv[]) { goto finish; } #endif +#endif /* HAVE_GETUID */ if (conf->cmd == PA_CMD_START && conf->system_instance) { pa_log(_("--start not supported for system instances.")); -- cgit