diff options
author | Peter Meerwald-Stadler <pmeerw@pmeerw.net> | 2017-03-07 16:29:30 +0100 |
---|---|---|
committer | Peter Meerwald-Stadler <pmeerw@pmeerw.net> | 2017-03-08 14:31:29 +0100 |
commit | a199b9045ea154b0996f3f74fcbe4c1adcd0aa22 (patch) | |
tree | 45eb40e45ab6b9120e0d7982a27b7967eb565bd8 /src/pulsecore | |
parent | 48ba5e4957414a2cf9eae23f08988c8fc2f9169a (diff) |
build: Use #ifdef to check for #defines
for example, in case HAVE_MEMFD is #undef, checking with #if HAVE_MEMFD
gives a warning (gcc 5.4.1, Ubuntu)
pulsecore/shm.c: In function 'sharedmem_create':
pulsecore/shm.c:208:5: warning: "HAVE_MEMFD" is not defined [-Wundef]
#if HAVE_MEMFD
use #ifdef or #if defined() to check for presence of a #define
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Diffstat (limited to 'src/pulsecore')
-rw-r--r-- | src/pulsecore/dbus-util.c | 4 | ||||
-rw-r--r-- | src/pulsecore/shm.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/pulsecore/dbus-util.c b/src/pulsecore/dbus-util.c index d786af49..80e2866e 100644 --- a/src/pulsecore/dbus-util.c +++ b/src/pulsecore/dbus-util.c @@ -100,7 +100,7 @@ static void handle_io_event(pa_mainloop_api *ea, pa_io_event *e, int fd, pa_io_e unsigned int flags = 0; DBusWatch *watch = userdata; -#if HAVE_DBUS_WATCH_GET_UNIX_FD +#ifdef HAVE_DBUS_WATCH_GET_UNIX_FD pa_assert(fd == dbus_watch_get_unix_fd(watch)); #else pa_assert(fd == dbus_watch_get_fd(watch)); @@ -153,7 +153,7 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *data) { ev = c->mainloop->io_new( c->mainloop, -#if HAVE_DBUS_WATCH_GET_UNIX_FD +#ifdef HAVE_DBUS_WATCH_GET_UNIX_FD dbus_watch_get_unix_fd(watch), #else dbus_watch_get_fd(watch), diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c index 919d71a8..0742cb88 100644 --- a/src/pulsecore/shm.c +++ b/src/pulsecore/shm.c @@ -205,7 +205,7 @@ static int sharedmem_create(pa_shm *m, pa_mem_type_t type, size_t size, mode_t m pa_assert_se(pa_close(fd) == 0); m->fd = -1; } -#if HAVE_MEMFD +#ifdef HAVE_MEMFD else m->fd = fd; #endif |