File mjpegtools-c++-17.patch of Package mjpegtools
github.com/gentoo/gentoo/pull/32171
github.com/gentoo/gentoo/commit/85deb61
media-video/mjpegtools: fix compiling at least with c++17 standard
- fixing usage of 'register' specifier since, since c++17 standard,
it's been removed
- fixing usage pf 'auto_ptr' since, since c++17 standard, it's been
removed
mjpegtools-2.2.1-c++17-register-fix.patch
--- a/utils/fastintfns.h
+++ b/utils/fastintfns.h
@@ -2,12 +2,12 @@
*
* WARNING: Assumes 2's complement arithmetic.
*/
-static inline int intmax( register int x, register int y )
+static inline int intmax( int x, int y )
{
return x < y ? y : x;
}
-static inline int intmin( register int x, register int y )
+static inline int intmin( int x, int y )
{
return x < y ? x : y;
}
mjpegtools-2.2.1-c++17-no-auto_ptr-fix.patch
--- a/mplex/main.cpp
+++ b/mplex/main.cpp
@@ -50,7 +50,7 @@
#include "multiplexor.hpp"
-using std::auto_ptr;
+using std::unique_ptr;
/*************************************************************************
@@ -138,7 +138,7 @@
void
FileOutputStream::NextSegment( )
{
- auto_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] );
+ unique_ptr<char[]> prev_filename_buf( new char[strlen(cur_filename)+1] );
char *prev_filename = prev_filename_buf.get();
fclose(strm);
++segment_num;