[Buildroot] [PATCH 1/1] package/mp4v2: needs gcc >= 5

Fabrice Fontaine fontaine.fabrice at gmail.com
Sun Feb 6 14:26:38 UTC 2022


TechSmith fork of mp4v2 needs gcc >= 5:
https://github.com/TechSmith/mp4v2/issues/47

As a result, the following build failure is raised since bump to version
5.0.1 in commit df22a9d6b77d9e245dceb7c8fd3f9d80c8917ca0:

In file included from ./include/mp4v2/mp4v2.h:58:0,
                 from ./libplatform/platform_posix.h:37,
                 from ./libplatform/platform.h:24,
                 from libplatform/impl.h:6:
./include/mp4v2/file.h:336:5: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
     ShouldParseAtomCallback cb = nullptr );
     ^

While a it, drop first patch which is not needed now that mp4v2 depends
on gcc >= 5

Fixes:
 - http://autobuild.buildroot.org/results/178f1266396d44c6659a67d8e68cb99e36d544ea

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 ...atic-cast-to-unsigned-int-for-cases.patch} |  0
 ...mp4track.cpp-replace-nullptr-by-NULL.patch | 50 -------------------
 package/mp4v2/Config.in                       |  6 ++-
 3 files changed, 4 insertions(+), 52 deletions(-)
 rename package/mp4v2/{0002-Static-cast-to-unsigned-int-for-cases.patch => 0001-Static-cast-to-unsigned-int-for-cases.patch} (100%)
 delete mode 100644 package/mp4v2/0001-src-mp4track.cpp-replace-nullptr-by-NULL.patch

diff --git a/package/mp4v2/0002-Static-cast-to-unsigned-int-for-cases.patch b/package/mp4v2/0001-Static-cast-to-unsigned-int-for-cases.patch
similarity index 100%
rename from package/mp4v2/0002-Static-cast-to-unsigned-int-for-cases.patch
rename to package/mp4v2/0001-Static-cast-to-unsigned-int-for-cases.patch
diff --git a/package/mp4v2/0001-src-mp4track.cpp-replace-nullptr-by-NULL.patch b/package/mp4v2/0001-src-mp4track.cpp-replace-nullptr-by-NULL.patch
deleted file mode 100644
index c279b9c56a..0000000000
--- a/package/mp4v2/0001-src-mp4track.cpp-replace-nullptr-by-NULL.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 78cf76b5d661e37e958163c37c0ad95940c09591 Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
-Date: Sat, 30 May 2020 11:42:19 +0200
-Subject: [PATCH] src/mp4track.cpp: replace nullptr by NULL
-
-Commit 15ec11166ba9ee7b77631d0d9234522f656cfd66 added code that uses
-nullptr. nullptr is C++11, it will break the build with gcc < 5.
-
-Semantically, NULL and nullptr are different, so should not be mixed.
-In this situaiton, m_File.FindAtom() indeed does not return nullptr,
-but NULL (on error, that is).
-
-Switch back to comparing against NULL.
-
-Fixes:
- - http://autobuild.buildroot.org/results/14937c96a82fb3d10e5d83bd7b2905b846fb09f9
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
-[Upstream status: https://github.com/TechSmith/mp4v2/pull/62]
----
- src/mp4track.cpp | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/mp4track.cpp b/src/mp4track.cpp
-index 4b8fc9d..42489eb 100644
---- a/src/mp4track.cpp
-+++ b/src/mp4track.cpp
-@@ -908,16 +908,16 @@ File* MP4Track::GetSampleFile( MP4SampleId sampleId )
-        MP4FtypAtom *pFtypAtom = reinterpret_cast<MP4FtypAtom *>( m_File.FindAtom( "ftyp" ) );
- 
-        // MOV spec does not require "ftyp" atom...
--       if ( pFtypAtom == nullptr )
-+       if ( pFtypAtom == NULL )
-        {
--          return nullptr;
-+          return NULL;
-        }
-        else
-        {
-           // ... but most often it is present with a "qt  " value
-           const char *majorBrand = pFtypAtom->majorBrand.GetValue();
-           if ( ::strcmp( pFtypAtom->majorBrand.GetValue(), "qt  " ) == 0 )
--             return nullptr;
-+             return NULL;
-        }
-        throw new Exception( "invalid stsd entry", __FILE__, __LINE__, __FUNCTION__ );
-     }
--- 
-2.26.2
-
diff --git a/package/mp4v2/Config.in b/package/mp4v2/Config.in
index 172d1baabe..00e80cd358 100644
--- a/package/mp4v2/Config.in
+++ b/package/mp4v2/Config.in
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_MP4V2
 	bool "mp4v2"
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # C++11
 	help
 	  The MP4v2 library provides functions to read, create, and
 	  modify mp4 files.
@@ -18,5 +19,6 @@ config BR2_PACKAGE_MP4V2_UTIL
 
 endif
 
-comment "mp4v2 needs a toolchain w/ C++"
-	depends on !BR2_INSTALL_LIBSTDCPP
+comment "mp4v2 needs a toolchain w/ C++, gcc >= 5"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_5
-- 
2.34.1




More information about the buildroot mailing list