Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

djvulibre: fix build with clang 16 #242094

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkgs/applications/misc/djvulibre/c++17-register-class.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -ur a/libdjvu/GBitmap.h b/libdjvu/GBitmap.h
--- a/libdjvu/GBitmap.h 2020-11-20 09:57:32.000000000 -0700
+++ b/libdjvu/GBitmap.h 2023-07-07 07:07:45.519912414 -0600
@@ -620,7 +620,7 @@
inline int
GBitmap::read_run(unsigned char *&data)
{
- register int z=*data++;
+ int z=*data++;
return (z>=RUNOVERFLOWVALUE)?
((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
}
@@ -628,7 +628,7 @@
inline int
GBitmap::read_run(const unsigned char *&data)
{
- register int z=*data++;
+ int z=*data++;
return (z>=RUNOVERFLOWVALUE)?
((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
}
4 changes: 4 additions & 0 deletions pkgs/applications/misc/djvulibre/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ stdenv.mkDerivation rec {
bash
];

# Remove uses of the `register` storage class specifier, which was removed in C++17.
# Fixes compilation with clang 16, which defaults to C++17.
patches = [ ./c++17-register-class.patch ];

enableParallelBuilding = true;

meta = with lib; {
Expand Down