From df869fd4f51957111cceddd2c799640c3dfdbb64 Mon Sep 17 00:00:00 2001
From: Federico Terraneo <fede.tft@miosix.org>
Date: Wed, 16 Nov 2022 00:39:05 +0100
Subject: [PATCH] Updated png++

---
 _tools/code_generators/libs/png++/README         |  2 +-
 _tools/code_generators/libs/png++/TODO           | 16 ----------------
 _tools/code_generators/libs/png++/error.hpp      |  2 +-
 .../libs/png++/solid_pixel_buffer.hpp            |  2 +-
 4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/_tools/code_generators/libs/png++/README b/_tools/code_generators/libs/png++/README
index cecdd74..cb7097e 100644
--- a/_tools/code_generators/libs/png++/README
+++ b/_tools/code_generators/libs/png++/README
@@ -53,7 +53,7 @@ or, for people w/o outgoing svn:
 
 Online documentation can be found here:
 
-	http://www.nongnu.org/pngpp/doc/html/index.html
+	http://www.nongnu.org/pngpp/doc/
 
 
 Help
diff --git a/_tools/code_generators/libs/png++/TODO b/_tools/code_generators/libs/png++/TODO
index 553afca..1c83abf 100644
--- a/_tools/code_generators/libs/png++/TODO
+++ b/_tools/code_generators/libs/png++/TODO
@@ -1,20 +1,4 @@
 ? add output transformations
-+ support for non-8bit data
-+ stream exceptions: badbit only
-+ adjust png::image for non-memory back end buffer + row-by-row io
-+ use doxygen
 - add optional and unknown chunks handling
-+ change bit_depth to size_t
-+ move tests sources to test/, examples to examples/
-+ extract common code from generator/consumer
-+ update pixel traits to detect channels count
-+ unify template parameters naming
-+ make sure all headers compile on their own
-+ add compilation dependency detection
-+ add pixel_buffer/image::operator[]
-+ improve docs and README
 ? endianness in expand_8_to_16()
 - unify error messages (capitalization, etc.)
-+ move stream template parameter from class to function level in
-  generator and consumer
-+ make all tests run even if any of them fails
diff --git a/_tools/code_generators/libs/png++/error.hpp b/_tools/code_generators/libs/png++/error.hpp
index 834cf1b..31e1801 100644
--- a/_tools/code_generators/libs/png++/error.hpp
+++ b/_tools/code_generators/libs/png++/error.hpp
@@ -100,7 +100,7 @@ namespace png
             strerror_s(buf, ERRBUF_SIZE, errnum);
             return std::string(buf);
 #else
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE
+#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (!__GLIBC__)
             strerror_r(errnum, buf, ERRBUF_SIZE);
             return std::string(buf);
 #else
diff --git a/_tools/code_generators/libs/png++/solid_pixel_buffer.hpp b/_tools/code_generators/libs/png++/solid_pixel_buffer.hpp
index 9f84245..65f97a9 100644
--- a/_tools/code_generators/libs/png++/solid_pixel_buffer.hpp
+++ b/_tools/code_generators/libs/png++/solid_pixel_buffer.hpp
@@ -164,7 +164,7 @@ namespace png
          */
         void put_row(size_t index, row_const_access r)
         {
-            row_access row = get_row();
+            row_access row = get_row(index);
             for (uint_32 i = 0; i < m_width; ++i)
                 *row++ = *r++;
         }
-- 
GitLab