lol

Merge pull request #259869 from reckenrode/mjpegtools-fix

mjpegtools: fix build with clang 16

authored by

toonn and committed by
GitHub
ee7c5f04 6bf753ad

+48
+44
pkgs/tools/video/mjpegtools/c++-17-fixes.patch
··· 1 + diff -ur a/mplex/main.cpp b/mplex/main.cpp 2 + --- a/mplex/main.cpp 2021-09-05 02:14:13.029372000 -0400 3 + +++ b/mplex/main.cpp 2023-09-23 08:47:07.683450627 -0400 4 + @@ -50,7 +50,7 @@ 5 + #include "multiplexor.hpp" 6 + 7 + 8 + -using std::auto_ptr; 9 + +using std::unique_ptr; 10 + 11 + 12 + /************************************************************************* 13 + @@ -138,7 +138,7 @@ 14 + void 15 + FileOutputStream::NextSegment( ) 16 + { 17 + - auto_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] ); 18 + + unique_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] ); 19 + char *prev_filename = prev_filename_buf.get(); 20 + fclose(strm); 21 + ++segment_num; 22 + diff -ur a/utils/fastintfns.h b/utils/fastintfns.h 23 + --- a/utils/fastintfns.h 2021-09-05 02:14:13.033372000 -0400 24 + +++ b/utils/fastintfns.h 2023-09-23 08:44:40.147112973 -0400 25 + @@ -2,12 +2,17 @@ 26 + * 27 + * WARNING: Assumes 2's complement arithmetic. 28 + */ 29 + -static inline int intmax( register int x, register int y ) 30 + +#ifdef __cplusplus 31 + +#define REGISTER 32 + +#else 33 + +#define REGISTER register 34 + +#endif 35 + +static inline int intmax( REGISTER int x, REGISTER int y ) 36 + { 37 + return x < y ? y : x; 38 + } 39 + 40 + -static inline int intmin( register int x, register int y ) 41 + +static inline int intmin( REGISTER int x, REGISTER int y ) 42 + { 43 + return x < y ? x : y; 44 + }
+4
pkgs/tools/video/mjpegtools/default.nix
··· 16 16 sha256 = "sha256-sYBTbX2ZYLBeACOhl7ANyxAJKaSaq3HRnVX0obIQ9Jo="; 17 17 }; 18 18 19 + # Clang 16 defaults to C++17. `std::auto_ptr` has been removed from C++17, and the 20 + # `register` type class specifier is no longer allowed. 21 + patches = [ ./c++-17-fixes.patch ]; 22 + 19 23 hardeningDisable = [ "format" ]; 20 24 21 25 nativeBuildInputs = [ pkg-config ];