This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cpan/Compress-Raw-Zlib - Update to version 2.205
[perl5.git] / cpan / Compress-Raw-Zlib / zlib-src / trees.c
index 20d3735..6d1e36a 100644 (file)
@@ -1,4 +1,3 @@
-
 /* trees.c -- output deflated data using Huffman coding
  * Copyright (C) 1995-2021 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
 
 #include "deflate.h"
 
+/*
+  Perl-specific change to allow building with C++
+  The 'register' keyword not allowed from C++17
+  see https://github.com/pmqs/Compress-Raw-Zlib/issues/23
+*/
+#define register
+
 #ifdef ZLIB_DEBUG
 #  include <ctype.h>
 #endif
@@ -1140,7 +1146,7 @@ local unsigned bi_reverse(
     unsigned code,
     int len)
 {
-    unsigned res = 0;
+    register unsigned res = 0;
     do {
         res |= code & 1;
         code >>= 1, res <<= 1;