Fixes to deal with newer png lib and C++11, as suggested by Mark van Rossum.
authorFrancois Fleuret <francois@fleuret.org>
Fri, 30 Jun 2017 15:13:44 +0000 (17:13 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Fri, 30 Jun 2017 15:13:44 +0000 (17:13 +0200)
Makefile
rgb_image.cc
shape.h

index d483ba5..0cf2320 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@
 #  You should have received a copy of the GNU General Public License
 #  along with selector.  If not, see <http://www.gnu.org/licenses/>.
 
-LDFLAGS=-lm -ljpeg -lpng
+LDFLAGS=-lm -ljpeg -lpng12
 
 ifeq ($(DEBUG),yes)
   OPTIMIZE_FLAG = -ggdb3 -DDEBUG -fno-omit-frame-pointer
index f803363..8922c4d 100644 (file)
@@ -25,7 +25,7 @@
 #include <iostream>
 #include <stdio.h>
 
-#include <libpng/png.h>
+#include <libpng12/png.h>
 #include "jpeg_misc.h"
 
 #include "rgb_image.h"
diff --git a/shape.h b/shape.h
index 5440197..190e7bd 100644 (file)
--- a/shape.h
+++ b/shape.h
 class Shape {
   static const int margin = 1;
   static const int nb_max_pixels = Vignette::width * Vignette::height;
+
+#if __cplusplus >= 201103L
+  static constexpr scalar_t gap_max = 0.25;
+#else
   static const scalar_t gap_max = 0.25;
+#endif
+
   int n_pixels1, n_pixels2, n_pixels3, n_pixels4;
   int nb_pixels;
   scalar_t xc, yc;