From: Takashi Sakamoto Date: Fri, 20 Nov 2020 05:19:44 +0000 (+0900) Subject: seq: client_info: conditional build for Linux kernel v4.6 or later X-Git-Tag: v0.2.0~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c9d72d352f531414555c6c02994e53fb812adabb;p=alsa-gobject.git seq: client_info: conditional build for Linux kernel v4.6 or later Some members were added to snd_seq_client_info strucutre in Linux kernel v4.6. This commit adds conditional macro to build for Linux kernel v4.6 or later. Signed-off-by: Takashi Sakamoto --- diff --git a/src/seq/client-info.c b/src/seq/client-info.c index 73f05c4..09ef937 100644 --- a/src/seq/client-info.c +++ b/src/seq/client-info.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: LGPL-3.0-or-later #include "privates.h" +#include #include @@ -101,12 +102,14 @@ static void seq_client_info_get_property(GObject *obj, guint id, GValue *val, case SEQ_CLIENT_INFO_PROP_LOST_COUNT: g_value_set_int(val, priv->info.event_lost); break; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) case SEQ_CLIENT_INFO_PROP_CARD_ID: g_value_set_int(val, priv->info.card); break; case SEQ_CLIENT_INFO_PROP_PROCESS_ID: g_value_set_int64(val, (gint64)priv->info.pid); break; +#endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec); break; @@ -171,14 +174,16 @@ static void alsaseq_client_info_class_init(ALSASeqClientInfoClass *klass) seq_client_info_props[SEQ_CLIENT_INFO_PROP_CARD_ID] = g_param_spec_int("card-id", "card-id", - "The numerical ID of sound card.", + "The numerical ID of sound card. " + "Available in Linux kernel 4.6.0 or later.", G_MININT, G_MAXINT, -1, G_PARAM_READWRITE); seq_client_info_props[SEQ_CLIENT_INFO_PROP_PROCESS_ID] = g_param_spec_int64("process-id", "process-id", - "The process ID for user client, otherwise -1.", + "The process ID for user client, otherwise -1. " + "Available in Linux kernel 4.6.0 or later", G_MININT64, G_MAXINT64, -1, G_PARAM_READABLE);