···11+diff -ur a/mplex/main.cpp b/mplex/main.cpp
22+--- a/mplex/main.cpp 2021-09-05 02:14:13.029372000 -0400
33++++ b/mplex/main.cpp 2023-09-23 08:47:07.683450627 -0400
44+@@ -50,7 +50,7 @@
55+ #include "multiplexor.hpp"
66+77+88+-using std::auto_ptr;
99++using std::unique_ptr;
1010+1111+1212+ /*************************************************************************
1313+@@ -138,7 +138,7 @@
1414+ void
1515+ FileOutputStream::NextSegment( )
1616+ {
1717+- auto_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] );
1818++ unique_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] );
1919+ char *prev_filename = prev_filename_buf.get();
2020+ fclose(strm);
2121+ ++segment_num;
2222+diff -ur a/utils/fastintfns.h b/utils/fastintfns.h
2323+--- a/utils/fastintfns.h 2021-09-05 02:14:13.033372000 -0400
2424++++ b/utils/fastintfns.h 2023-09-23 08:44:40.147112973 -0400
2525+@@ -2,12 +2,17 @@
2626+ *
2727+ * WARNING: Assumes 2's complement arithmetic.
2828+ */
2929+-static inline int intmax( register int x, register int y )
3030++#ifdef __cplusplus
3131++#define REGISTER
3232++#else
3333++#define REGISTER register
3434++#endif
3535++static inline int intmax( REGISTER int x, REGISTER int y )
3636+ {
3737+ return x < y ? y : x;
3838+ }
3939+4040+-static inline int intmin( register int x, register int y )
4141++static inline int intmin( REGISTER int x, REGISTER int y )
4242+ {
4343+ return x < y ? x : y;
4444+ }
+4
pkgs/tools/video/mjpegtools/default.nix
···1616 sha256 = "sha256-sYBTbX2ZYLBeACOhl7ANyxAJKaSaq3HRnVX0obIQ9Jo=";
1717 };
18181919+ # Clang 16 defaults to C++17. `std::auto_ptr` has been removed from C++17, and the
2020+ # `register` type class specifier is no longer allowed.
2121+ patches = [ ./c++-17-fixes.patch ];
2222+1923 hardeningDisable = [ "format" ];
20242125 nativeBuildInputs = [ pkg-config ];