From: Fabrice Fontaine Date: Thu, 5 Aug 2021 08:01:07 +0000 (+0200) Subject: package/libebml: fix build with gcc 11 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1116a3060955c36c43a8bea5f1f00ea4effb4e48;p=buildroot.git package/libebml: fix build with gcc 11 Fix the following build failure with gcc 11: /tmp/instance-0/output-1/build/libebml-1.4.2/src/EbmlString.cpp: In member function 'virtual filepos_t libebml::EbmlString::ReadData(libebml::IOCallback&, libebml::ScopeMode)': /tmp/instance-0/output-1/build/libebml-1.4.2/src/EbmlString.cpp:147:41: error: 'numeric_limits' is not a member of 'std' 147 | auto Buffer = (GetSize() + 1 < std::numeric_limits::max()) ? new (std::nothrow) char[GetSize() + 1] : nullptr; | ^~~~~~~~~~~~~~ /tmp/instance-0/output-1/build/libebml-1.4.2/src/EbmlString.cpp:147:67: error: expected primary-expression before '>' token 147 | auto Buffer = (GetSize() + 1 < std::numeric_limits::max()) ? new (std::nothrow) char[GetSize() + 1] : nullptr; | ^ /tmp/instance-0/output-1/build/libebml-1.4.2/src/EbmlString.cpp:147:70: error: '::max' has not been declared; did you mean 'std::max'? 147 | auto Buffer = (GetSize() + 1 < std::numeric_limits::max()) ? new (std::nothrow) char[GetSize() + 1] : nullptr; | ^~~ | std::max Fixes: - http://autobuild.buildroot.org/results/3a28507127eae47994ca62e2b656da32bd2fb1f8 Signed-off-by: Fabrice Fontaine Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/package/libebml/0001-include-appropriate-header-files-for-std-numeric_limits.patch b/package/libebml/0001-include-appropriate-header-files-for-std-numeric_limits.patch new file mode 100644 index 0000000000..83d1b92051 --- /dev/null +++ b/package/libebml/0001-include-appropriate-header-files-for-std-numeric_limits.patch @@ -0,0 +1,52 @@ +From f0bfd53647961e799a43d918c46cf3b6bff89806 Mon Sep 17 00:00:00 2001 +From: Moritz Bunkus +Date: Sat, 27 Feb 2021 20:36:52 +0100 +Subject: [PATCH] include appropriate header files for std::numeric_limits + +Fixes #80. + +[Retrieved from: +https://github.com/Matroska-Org/libebml/commit/f0bfd53647961e799a43d918c46cf3b6bff89806] +Signed-off-by: Fabrice Fontaine +--- + ChangeLog | 4 ++++ + src/EbmlString.cpp | 1 + + src/EbmlUnicodeString.cpp | 1 + + 3 files changed, 6 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 034cf86..e4b13a9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2021-02-27 Moritz Bunkus ++ ++ * Fix compilation with g++ 11. Fixes #80. ++ + 2021-02-21 Steve Lhomme + + * Remove Coremake project files +diff --git a/src/EbmlString.cpp b/src/EbmlString.cpp +index 27e55fd..4c05fcf 100644 +--- a/src/EbmlString.cpp ++++ b/src/EbmlString.cpp +@@ -34,6 +34,7 @@ + \author Steve Lhomme + */ + #include ++#include + + #include "ebml/EbmlString.h" + +diff --git a/src/EbmlUnicodeString.cpp b/src/EbmlUnicodeString.cpp +index 496a16a..99fc073 100644 +--- a/src/EbmlUnicodeString.cpp ++++ b/src/EbmlUnicodeString.cpp +@@ -36,6 +36,7 @@ + */ + + #include ++#include + + #include "ebml/EbmlUnicodeString.h" +