readsb: fix compilation with GCC10
authorRosen Penev <redacted>
Mon, 29 Jun 2020 23:52:36 +0000 (16:52 -0700)
committerRosen Penev <redacted>
Tue, 30 Jun 2020 21:53:21 +0000 (14:53 -0700)
Upstream backport.

Signed-off-by: Rosen Penev <redacted>
utils/readsb/Makefile
utils/readsb/patches/010-gcc10.patch [new file with mode: 0644]

index 535580ccb030c955ab15aa6e16eb36916b913fd1..dc46e98cf2bf536b70840ed823f962d00546671a 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=readsb
 PKG_VERSION:=3.8.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/Mictronics/readsb/tar.gz/v$(PKG_VERSION)?
diff --git a/utils/readsb/patches/010-gcc10.patch b/utils/readsb/patches/010-gcc10.patch
new file mode 100644 (file)
index 0000000..2ef9722
--- /dev/null
@@ -0,0 +1,61 @@
+From 5119c21ae56f1c7fd0b10250d1beca9634bf74af Mon Sep 17 00:00:00 2001
+From: Mictronics <github@mictronics.de>
+Date: Sun, 14 Jun 2020 18:06:22 +0200
+Subject: [PATCH] Clean up linkage of struct Modes.
+
+---
+ readsb.c         | 2 ++
+ readsb.h         | 6 ++++--
+ viewadsb.c       | 2 ++
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/readsb.c b/readsb.c
+index e784d891..d6dab324 100644
+--- a/readsb.c
++++ b/readsb.c
+@@ -57,6 +57,8 @@
+ #include <stdarg.h>
++struct _Modes Modes;
++
+ //
+ // ============================= Program options help ==========================
+ //
+diff --git a/readsb.h b/readsb.h
+index 3a1b22d5..1b80c338 100644
+--- a/readsb.h
++++ b/readsb.h
+@@ -312,7 +312,7 @@ struct mag_buf
+ // Program global state
+-struct
++struct _Modes
+ { // Internal state
+   pthread_cond_t data_cond; // Conditional variable associated
+   pthread_t reader_thread;
+@@ -412,7 +412,9 @@ struct
+   struct stats stats_15min;
+   struct timespec reader_cpu_accumulator; // CPU time used by the reader thread, copied out and reset by the main thread under the mutex
+   struct mag_buf mag_buffers[MODES_MAG_BUFFERS]; // Converted magnitude buffers from RTL or file input
+-} Modes;
++};
++
++extern struct _Modes Modes;
+ // The struct we use to store information about a decoded message.
+diff --git a/viewadsb.c b/viewadsb.c
+index ad7b1bd0..915305b6 100644
+--- a/viewadsb.c
++++ b/viewadsb.c
+@@ -54,6 +54,8 @@
+ #include "readsb.h"
+ #include "help.h"
++struct _Modes Modes;
++
+ #define _stringize(x) x
+ #define verstring(x) _stringize(x)
git clone https://git.99rst.org/PROJECT