From 8a2e11ee28cb4afbd799db631d6d25c5652541be Mon Sep 17 00:00:00 2001 From: Charlotte Meyer Date: Thu, 7 Mar 2019 18:51:33 +0100 Subject: [PATCH] Supress UNUSED parameter warnings --- kiwmi/output.c | 2 +- meson.build | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kiwmi/output.c b/kiwmi/output.c index 4821651..60d429a 100644 --- a/kiwmi/output.c +++ b/kiwmi/output.c @@ -58,7 +58,7 @@ output_frame_notify(struct wl_listener *listener, void *data) } static void -output_destroy_nofity(struct wl_listener *listener, void *data) +output_destroy_nofity(struct wl_listener *listener, void *UNUSED(data)) { struct kiwmi_output *output = wl_container_of(listener, output, destroy); diff --git a/meson.build b/meson.build index 9d2f6ad..a3b3e08 100644 --- a/meson.build +++ b/meson.build @@ -36,4 +36,11 @@ else endif add_project_arguments('-DKIWMI_VERSION=@0@'.format(version), language: 'c') +compiler = meson.get_compiler('c') +if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' + add_project_arguments('-DUNUSED(x)=UNUSED_ ## x __attribute__((__unused__))', language: 'c') +else + add_project_arguments('-DUNUSED(x)=UNUSED_ ## x', language: 'c') +endif + subdir('kiwmi')