Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/rtl-sdr/files/, net-wireless/rtl-sdr/
Date: Sat, 04 Feb 2017 01:49:27
Message-Id: 1486172958.3d64639800770244b29767889e2e21a24c39dd91.vapier@gentoo
1 commit: 3d64639800770244b29767889e2e21a24c39dd91
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 4 01:48:47 2017 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 4 01:49:18 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d646398
7
8 net-wireless/rtl-sdr: fix builds w/newer compiler standards
9
10 .../files/rtl-sdr-0.5.3-static-inline.patch | 66 ++++++++++++++++++++++
11 .../rtl-sdr/rtl-sdr-0.5.3_p20150730.ebuild | 4 ++
12 2 files changed, 70 insertions(+)
13
14 diff --git a/net-wireless/rtl-sdr/files/rtl-sdr-0.5.3-static-inline.patch b/net-wireless/rtl-sdr/files/rtl-sdr-0.5.3-static-inline.patch
15 new file mode 100644
16 index 00000000..0f0e829
17 --- /dev/null
18 +++ b/net-wireless/rtl-sdr/files/rtl-sdr-0.5.3-static-inline.patch
19 @@ -0,0 +1,66 @@
20 +https://github.com/steve-m/librtlsdr/pull/38
21 +
22 +From ea6a86d8e792430faa3a8161ee99f2bc392875d1 Mon Sep 17 00:00:00 2001
23 +From: Mike Frysinger <vapier@××××××××.org>
24 +Date: Fri, 3 Feb 2017 15:44:18 -1000
25 +Subject: [PATCH] fix builds with newer compilers & C standards
26 +
27 +The meaning of "inline" has changed when "static" is not used.
28 +Since none of these functions are used outside of their respective
29 +files, mark them as static to avoid build errors where funcs are
30 +not inlined (based on compiler flags too).
31 +---
32 + src/rtl_adsb.c | 8 ++++----
33 + src/rtl_power.c | 2 +-
34 + 2 files changed, 5 insertions(+), 5 deletions(-)
35 +
36 +diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c
37 +index e611e78f3dad..a3bfa7f36b5e 100644
38 +--- a/src/rtl_adsb.c
39 ++++ b/src/rtl_adsb.c
40 +@@ -182,7 +182,7 @@ int magnitute(uint8_t *buf, int len)
41 + return len/2;
42 + }
43 +
44 +-inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
45 ++static inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
46 + /* takes 4 consecutive real samples, return 0 or 1, BADSAMPLE on error */
47 + {
48 + int bit, bit_p;
49 +@@ -223,17 +223,17 @@ inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d
50 + return BADSAMPLE;
51 + }
52 +
53 +-inline uint16_t min16(uint16_t a, uint16_t b)
54 ++static inline uint16_t min16(uint16_t a, uint16_t b)
55 + {
56 + return a<b ? a : b;
57 + }
58 +
59 +-inline uint16_t max16(uint16_t a, uint16_t b)
60 ++static inline uint16_t max16(uint16_t a, uint16_t b)
61 + {
62 + return a>b ? a : b;
63 + }
64 +
65 +-inline int preamble(uint16_t *buf, int i)
66 ++static inline int preamble(uint16_t *buf, int i)
67 + /* returns 0/1 for preamble at index i */
68 + {
69 + int i2;
70 +diff --git a/src/rtl_power.c b/src/rtl_power.c
71 +index aa7a138a8cd3..a7a43bbd2507 100644
72 +--- a/src/rtl_power.c
73 ++++ b/src/rtl_power.c
74 +@@ -249,7 +249,7 @@ void sine_table(int size)
75 + }
76 + }
77 +
78 +-inline int16_t FIX_MPY(int16_t a, int16_t b)
79 ++static inline int16_t FIX_MPY(int16_t a, int16_t b)
80 + /* fixed point multiply and scale */
81 + {
82 + int c = ((int)a * (int)b) >> 14;
83 +--
84 +2.11.0
85 +
86
87 diff --git a/net-wireless/rtl-sdr/rtl-sdr-0.5.3_p20150730.ebuild b/net-wireless/rtl-sdr/rtl-sdr-0.5.3_p20150730.ebuild
88 index b33b615..8f1c5e6 100644
89 --- a/net-wireless/rtl-sdr/rtl-sdr-0.5.3_p20150730.ebuild
90 +++ b/net-wireless/rtl-sdr/rtl-sdr-0.5.3_p20150730.ebuild
91 @@ -26,6 +26,10 @@ IUSE=""
92 DEPEND="virtual/libusb:1"
93 RDEPEND="${DEPEND}"
94
95 +PATCHES=(
96 + "${FILESDIR}"/${PN}-0.5.3-static-inline.patch
97 +)
98 +
99 src_unpack() {
100 if [[ ${PV} == 9999* ]]; then
101 git-r3_src_unpack