gigi problems with libpng 1.4.x

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
phalaxy
Space Krill
Posts: 2
Joined: Wed Aug 25, 2010 6:49 pm

gigi problems with libpng 1.4.x

#1 Post by phalaxy » Wed Aug 25, 2010 7:02 pm

hi,

please adapt gigi to the latest libpng branch which is 1.4.x, because gigi doesnt compile with it.

thanks

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12563
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: gigi problems with libpng 1.4.x

#2 Post by Geoff the Medio » Wed Aug 25, 2010 9:11 pm

This issue has been known for a while, but unfortunately won't be fixed soon due to the unavailability of the GG maintainer. For now, I suggest using libpng 1.2.x if you can.

wiz
Space Krill
Posts: 2
Joined: Sat Sep 04, 2010 10:28 am

Re: gigi problems with libpng 1.4.x

#3 Post by wiz » Sat Sep 04, 2010 10:41 am

viewtopic.php?p=43308#p43308
contains the proper solution.

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: gigi problems with libpng 1.4.x

#4 Post by q1w2e3r4 » Sun Sep 26, 2010 11:09 pm

Hi,

I created a small patch to allow gigi to compile with libpng 1.4:

Code: Select all

--- src/GIL/extension/io/png_io.hpp.orig	2010-09-26 13:48:14.524669596 -0600
+++ src/GIL/extension/io/png_io.hpp	2010-09-26 13:48:24.601670929 -0600
@@ -9,6 +9,8 @@
 */
 
 /*************************************************************************************************/
+#define png_infopp_NULL (png_infopp)NULL
+#define int_p_NULL (int*)NULL
 
 #ifndef GIL_PNG_IO_H
 #define GIL_PNG_IO_H
--- src/GIL/extension/io/png_io_private.hpp.orig	2010-09-26 13:47:45.113932056 -0600
+++ src/GIL/extension/io/png_io_private.hpp	2010-09-26 13:48:04.873671113 -0600
@@ -10,6 +10,8 @@
     See http://stlab.adobe.com/gil for most recent version including documentation.
 */
 /*************************************************************************************************/
+#define png_infopp_NULL (png_infopp)NULL
+#define int_p_NULL (int*)NULL
 
 #ifndef GIL_PNG_IO_PRIVATE_H
 #define GIL_PNG_IO_PRIVATE_H
--- src/GIL/extension/io/png_io_private.hpp.orig	2010-09-26 14:01:59.000000000 -0600
+++ src/GIL/extension/io/png_io_private.hpp	2010-09-26 14:03:52.000000000 -0600
@@ -312,7 +312,7 @@ public:
             case 4:
             case 8:
                 if(bit_depth < 8)
-                    png_set_gray_1_2_4_to_8(_png_ptr);
+                    png_set_expand_gray_1_2_4_to_8(_png_ptr);
                 png_read_and_convert_pixels<gray8_pixel_t,gray8_ref_t>(view,_cc,_png_ptr,width,height,interlaced);
                 break;
             case 16:
@@ -350,7 +350,7 @@ public:
             case 4:
             case 8:
                 if(bit_depth < 8)
-                    png_set_gray_1_2_4_to_8(_png_ptr);
+                    png_set_expand_gray_1_2_4_to_8(_png_ptr);
                 png_read_and_convert_pixels<gray_alpha8_pixel_t,gray_alpha8_ref_t>(view,_cc,_png_ptr,width,height,interlaced);
                 break;
             case 16:


also to get by compiling with gcc 4.5:

Code: Select all

--- GG/adobe/cmath.hpp.orig	2010-09-26 14:09:50.000000000 -0600
+++ GG/adobe/cmath.hpp	2010-09-26 14:10:21.000000000 -0600
@@ -37,7 +37,7 @@ back to include math.h. This also needs
 
 #define ADOBE_HAS_CPP_CMATH 
 
-#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 4))
+#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 5))
 /*
     The currently supported version of GNUC has C99 extensions in math.h. But no TR1 extensions.
 */



Post Reply