Skip to content

Commit

Permalink
Merge pull request #242094 from reckenrode/djvulibre-clang16
Browse files Browse the repository at this point in the history
djvulibre: fix build with clang 16
  • Loading branch information
wegank authored Aug 5, 2023
2 parents 00caa49 + f0f5343 commit 8fb2569
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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

0 comments on commit 8fb2569

Please sign in to comment.