diff options
author | toonn <toonn@toonn.io> | 2023-10-11 19:49:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 19:49:29 +0200 |
commit | ee7c5f04fbf2a012f479e89dd917be7d0d541de7 (patch) | |
tree | 6f3013505619f4a910552ee57be400f9747a2614 /pkgs/tools/video | |
parent | 6bf753ada1af0d923884021ba6ab627fa560dde8 (diff) | |
parent | 9622ba47e9c86933302d4e039bcfbb97c4b0e9ec (diff) |
Merge pull request #259869 from reckenrode/mjpegtools-fix
mjpegtools: fix build with clang 16
Diffstat (limited to 'pkgs/tools/video')
-rw-r--r-- | pkgs/tools/video/mjpegtools/c++-17-fixes.patch | 44 | ||||
-rw-r--r-- | pkgs/tools/video/mjpegtools/default.nix | 4 |
2 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/tools/video/mjpegtools/c++-17-fixes.patch b/pkgs/tools/video/mjpegtools/c++-17-fixes.patch new file mode 100644 index 0000000000000..018cc7e9beabd --- /dev/null +++ b/pkgs/tools/video/mjpegtools/c++-17-fixes.patch @@ -0,0 +1,44 @@ +diff -ur a/mplex/main.cpp b/mplex/main.cpp +--- a/mplex/main.cpp 2021-09-05 02:14:13.029372000 -0400 ++++ b/mplex/main.cpp 2023-09-23 08:47:07.683450627 -0400 +@@ -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; +diff -ur a/utils/fastintfns.h b/utils/fastintfns.h +--- a/utils/fastintfns.h 2021-09-05 02:14:13.033372000 -0400 ++++ b/utils/fastintfns.h 2023-09-23 08:44:40.147112973 -0400 +@@ -2,12 +2,17 @@ + * + * WARNING: Assumes 2's complement arithmetic. + */ +-static inline int intmax( register int x, register int y ) ++#ifdef __cplusplus ++#define REGISTER ++#else ++#define REGISTER register ++#endif ++static inline int intmax( REGISTER int x, REGISTER int y ) + { + return x < y ? y : x; + } + +-static inline int intmin( register int x, register int y ) ++static inline int intmin( REGISTER int x, REGISTER int y ) + { + return x < y ? x : y; + } diff --git a/pkgs/tools/video/mjpegtools/default.nix b/pkgs/tools/video/mjpegtools/default.nix index 675dfc109de13..f231d6ed184da 100644 --- a/pkgs/tools/video/mjpegtools/default.nix +++ b/pkgs/tools/video/mjpegtools/default.nix @@ -16,6 +16,10 @@ stdenv.mkDerivation rec { sha256 = "sha256-sYBTbX2ZYLBeACOhl7ANyxAJKaSaq3HRnVX0obIQ9Jo="; }; + # Clang 16 defaults to C++17. `std::auto_ptr` has been removed from C++17, and the + # `register` type class specifier is no longer allowed. + patches = [ ./c++-17-fixes.patch ]; + hardeningDisable = [ "format" ]; nativeBuildInputs = [ pkg-config ]; |