From: c vw <dl1ycf@darc.de>
Date: Fri, 23 Jul 2021 13:18:48 +0000 (+0200)
Subject: let it compile with old libgipod
X-Git-Url: https://git.rkrishnan.org/vdrive/components/simplejson/-?a=commitdiff_plain;h=477629dd03d1dc3e0cd23135034de1f0e98a14b3;p=pihpsdr.git

let it compile with old libgipod
---

diff --git a/gpio.c b/gpio.c
index a61244e..277bed0 100644
--- a/gpio.c
+++ b/gpio.c
@@ -1088,6 +1088,7 @@ void gpio_cw_sidetone_set(int level) {
   int rc;
   if (ENABLE_GPIO_SIDETONE) {
 #ifdef GPIO
+#ifdef OLD_GPIOD
     //
     // changed from gpiod_ctxless_set_value_ext to gpiod_ctxless_set_value,
     // so it works with older gpiod libs
@@ -1095,6 +1096,11 @@ void gpio_cw_sidetone_set(int level) {
     if((rc=gpiod_ctxless_set_value(gpio_device,SIDETONE_GPIO,level,FALSE,consumer,NULL,NULL))<0) {
       g_print("%s: err=%d\n",__FUNCTION__,rc);
     }
+#else
+    if((rc=gpiod_ctxless_set_value_ext(gpio_device,SIDETONE_GPIO,level,FALSE,consumer,NULL,NULL,0))<0) {
+      g_print("%s: err=%d\n",__FUNCTION__,rc);
+    }
+#endif
 #endif
   }
 }