summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Simoes <ricardo.simoes@pt.bosch.com>2024-08-26 16:16:44 +0200
committerKhem Raj <raj.khem@gmail.com>2024-08-26 07:36:10 -0700
commita4cad069d2c036f9e6ef07e57bb35d91008d1ff7 (patch)
treef3fe7a45dd24f6f73efaa653fa2fd5f4f3e49788
parent3f825482d339d66f03b1578cc4cc1d75da7b439c (diff)
downloadmeta-openembedded-a4cad069d2c036f9e6ef07e57bb35d91008d1ff7.tar.gz
directfb: Fix C++17 build warning
DirectFB explicitly supports usage of C++. With C++17 and later the below warning is given: lib/direct/util.h:223:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 223 | register int ret = 0; | ^~~ To address that, this commit brings in the patch proposed by PR which removes the usage of the register keyword: https://github.com/deniskropp/DirectFB/pull/25 Signed-off-by: Ricardo Simoes <ricardo.simoes@pt.bosch.com> Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-graphics/directfb/directfb.inc1
-rw-r--r--meta-oe/recipes-graphics/directfb/directfb/0001-libdirect-remove-use-of-keyword-register.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/directfb/directfb.inc b/meta-oe/recipes-graphics/directfb/directfb.inc
index 313c9d16f0..59796cc65f 100644
--- a/meta-oe/recipes-graphics/directfb/directfb.inc
+++ b/meta-oe/recipes-graphics/directfb/directfb.inc
@@ -25,6 +25,7 @@ SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/DirectFB-${PV}.tar.g
25 file://0001-os-linux-Fix-build-when-__NR_futex-is-not-available.patch \ 25 file://0001-os-linux-Fix-build-when-__NR_futex-is-not-available.patch \
26 file://0001-include-libgen.h-for-basename.patch \ 26 file://0001-include-libgen.h-for-basename.patch \
27 file://0001-inputdrivers-Correct-the-signature-of-bind-call-on-m.patch \ 27 file://0001-inputdrivers-Correct-the-signature-of-bind-call-on-m.patch \
28 file://0001-libdirect-remove-use-of-keyword-register.patch \
28 " 29 "
29 30
30S = "${WORKDIR}/DirectFB-${PV}" 31S = "${WORKDIR}/DirectFB-${PV}"
diff --git a/meta-oe/recipes-graphics/directfb/directfb/0001-libdirect-remove-use-of-keyword-register.patch b/meta-oe/recipes-graphics/directfb/directfb/0001-libdirect-remove-use-of-keyword-register.patch
new file mode 100644
index 0000000000..24d977f4dc
--- /dev/null
+++ b/meta-oe/recipes-graphics/directfb/directfb/0001-libdirect-remove-use-of-keyword-register.patch
@@ -0,0 +1,44 @@
1From f6cdb9f1c3dbef8ef695703a2a5fb4e92b2dd8a0 Mon Sep 17 00:00:00 2001
2From: Simon Barth <simon.barth@gmx.de>
3Date: Mon, 5 Aug 2024 19:35:16 +0200
4Subject: [PATCH] libdirect: remove use of keyword 'register'
5
6The 'register' keyword was removed in C++17 and is now unused and
7reserved. When compiling code that uses DirecthFB with C++17,
8compilation fails.
9
10Since modern compilers likely don't produce different code whether the
11'register' keyword is used or not, there shouldn't be any performance
12impact introduced by this change.
13
14Signed-off-by: Simon Barth <simon.barth@gmx.de>
15
16Upstream-Status: Submitted [https://github.com/deniskropp/DirectFB/pull/25]
17---
18 lib/direct/util.h | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/lib/direct/util.h b/lib/direct/util.h
22index 2109b6ca1..734645796 100644
23--- a/lib/direct/util.h
24+++ b/lib/direct/util.h
25@@ -220,7 +220,7 @@ void DIRECT_API direct_md5_sum( void *dst, const void *src, const int len );
26 static __inline__ int
27 direct_util_count_bits( unsigned int mask )
28 {
29- register int ret = 0;
30+ int ret = 0;
31
32 while (mask) {
33 ret += mask & 1;
34@@ -325,7 +325,7 @@ D_ICEIL(float f)
35 static __inline__ int
36 direct_log2( int val )
37 {
38- register int ret = 0;
39+ int ret = 0;
40
41 while (val >> ++ret);
42
43--
442.25.1