Browse Source

dump1900: fix compilation with GCC10

Upstream backport.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 4 years ago
parent
commit
59d7475aa6
No known key found for this signature in database GPG Key ID: 36D31CFA845F0E3B
2 changed files with 81 additions and 1 deletions
  1. +1
    -1
      utils/dump1090/Makefile
  2. +80
    -0
      utils/dump1090/patches/010-gcc10.patch

+ 1
- 1
utils/dump1090/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dump1090 PKG_NAME:=dump1090
PKG_VERSION:=3.8.1 PKG_VERSION:=3.8.1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/flightaware/dump1090/tar.gz/v${PKG_VERSION}? PKG_SOURCE_URL:=https://codeload.github.com/flightaware/dump1090/tar.gz/v${PKG_VERSION}?


+ 80
- 0
utils/dump1090/patches/010-gcc10.patch View File

@ -0,0 +1,80 @@
From 0793c64ee8ebbcea86b7a9dc71c7e28ec08db618 Mon Sep 17 00:00:00 2001
From: Oliver Jowett <oliver.jowett@flightaware.com>
Date: Sat, 6 Jun 2020 21:52:04 +0800
Subject: [PATCH] Clean up linkage of struct Modes to actually make sense.
(how did this work before? But it's been unchanged since at least
2013..)
Maybe fixes #65
---
dump1090.c | 2 ++
dump1090.h | 6 ++++--
faup1090.c | 2 ++
view1090.c | 3 +++
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dump1090.c b/dump1090.c
index 2b5c4dce..bc1a7bb9 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -51,6 +51,8 @@
#include <stdarg.h>
+struct _Modes Modes;
+
//
// ============================= Utility functions ==========================
//
diff --git a/dump1090.h b/dump1090.h
index 5c7cf73e..1afc3d35 100644
--- a/dump1090.h
+++ b/dump1090.h
@@ -295,7 +295,7 @@ struct mag_buf {
};
// Program global state
-struct { // Internal state
+struct _Modes { // Internal state
pthread_t reader_thread;
pthread_mutex_t data_mutex; // Mutex to synchronize buffer access
@@ -397,7 +397,9 @@ struct { // Internal state
int stats_latest_1min;
struct stats stats_5min;
struct stats stats_15min;
-} Modes;
+};
+
+extern struct _Modes Modes;
// The struct we use to store information about a decoded message.
struct modesMessage {
diff --git a/faup1090.c b/faup1090.c
index cd2be929..cf83db9d 100644
--- a/faup1090.c
+++ b/faup1090.c
@@ -49,6 +49,8 @@
#include "dump1090.h"
+struct _Modes Modes;
+
#include <stdarg.h>
void receiverPositionChanged(float lat, float lon, float alt)
diff --git a/view1090.c b/view1090.c
index ae925f5e..a8797bb8 100644
--- a/view1090.c
+++ b/view1090.c
@@ -28,6 +28,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#include "dump1090.h"
+
+struct _Modes Modes;
+
//
// ============================= Utility functions ==========================
//

Loading…
Cancel
Save