package/libebml: fix build with gcc 11
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 5 Aug 2021 08:01:07 +0000 (10:01 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Thu, 5 Aug 2021 16:51:31 +0000 (18:51 +0200)
commit1116a3060955c36c43a8bea5f1f00ea4effb4e48
tree991844cdc7314f6e1509440592722df64cc7a614
parent63ecfad96ad653e445d57632c81f5f27fa1761ca
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<std::size_t>::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<std::size_t>::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<std::size_t>::max()) ? new (std::nothrow) char[GetSize() + 1] : nullptr;
      |                                                                      ^~~
      |                                                                      std::max

Fixes:
 - http://autobuild.buildroot.org/results/3a28507127eae47994ca62e2b656da32bd2fb1f8

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/libebml/0001-include-appropriate-header-files-for-std-numeric_limits.patch [new file with mode: 0644]