Hi!

Upstream here :)

I can confirm the issue, we fixed it in r9003
(http://bugs.arb-home.de/changeset/9003). Since ARB 6 is just about
ready, we won't do any more releases in the 5.x series, so I've
backported the fix for you (patch attached).

best,
Elmar

On 03/17/2014 01:42 AM, Nobuhiro Iwamatsu wrote:
> Source: arb
> Version: 5.5-5
> Severity: important
> User: lib...@packages.debian.org
> Usertags: libpng15-transition
> 
> Hi,
> 
> libpng maintainers have a plan transition of libpng[0].
> 
> libpng is already installed in experimental, and we are re-building
> the package depending on libpng16.
> 
> We checked that your package was FTBFS.
> Would you check also in your environment?
> And if a problem can be checked, could you fix this?
> 
> -----
> 
> cc -O4 -pipe -fmessage-length=0 -funit-at-a-time -fPIC -DARB_OPENGL
> -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
> -Werror=format-security -W -Wall -DNDEBUG -DARB_64  -DLINUX
> -DFAKE_VTAB_PTR=char -DIN_ARB_GL -DIN_ARB_glpng -c glpng.c -I.
> -I/tmp/buildd/arb-5.5/INCLUDE -I/include
> In file included from glpng.c:35:0:
> /tmp/buildd/arb-5.5/INCLUDE/GL/glpng.h:60:23: error: expected
> identifier or '(' before '-' token
>  #define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
>                        ^
> /tmp/buildd/arb-5.5/INCLUDE/GL/glpng.h:60:23: error: expected
> identifier or '(' before '-' token
>  #define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
>                        ^
> /tmp/buildd/arb-5.5/INCLUDE/GL/glpng.h:60:23: error: expected
> identifier or '(' before '-' token
>  #define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
>                        ^
> /tmp/buildd/arb-5.5/INCLUDE/GL/glpng.h:60:23: error: expected
> identifier or '(' before '-' token
>  #define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
> 
> -----
> 
> Best regards,
>   Nobuhiro
> 
> [0]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650601
> 
> Best regards,
>   Nobuhiro
> 
diff -rNu arbsrc_9167/GL/glpng/glpng.c arbsrc_9167.new/GL/glpng/glpng.c
--- arbsrc_9167/GL/glpng/glpng.c	2012-11-14 13:13:45.000000000 +0100
+++ arbsrc_9167.new/GL/glpng/glpng.c	2014-03-17 05:04:53.493971219 +0100
@@ -38,9 +38,9 @@
 #include <png.h>
 
 #if 0
-#define PNG_CHECK_SIG(header,size) png_check_sig(header,size) // old libpng
+#define GLPNG_CHECK_SIG(header,size) png_check_sig(header,size) // old libpng
 #else
-#define PNG_CHECK_SIG(header,size) (png_sig_cmp(header,0,size)==0)
+#define GLPNG_CHECK_SIG(header,size) (png_sig_cmp(header,0,size)==0)
 #endif
 
 /* Used to decide if GL/gl.h supports the paletted extension */
@@ -284,7 +284,7 @@
     if (pinfo == NULL) return 0;
 
     fread(header, 1, 8, fp);
-    if (!PNG_CHECK_SIG(header, 8)) return 0;
+    if (!GLPNG_CHECK_SIG(header, 8)) return 0;
 
     png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
     info = png_create_info_struct(png);
@@ -437,12 +437,12 @@
     if (color == PNG_COLOR_TYPE_GRAY || color == PNG_COLOR_TYPE_GRAY_ALPHA)
         png_set_gray_to_rgb(png);
 
-    if (color&PNG_COLOR_MASK_ALPHA && trans != PNG_ALPHA) {
+    if (color&PNG_COLOR_MASK_ALPHA && trans != GLPNG_ALPHA) {
         png_set_strip_alpha(png);
         color &= ~PNG_COLOR_MASK_ALPHA;
     }
 
-    if (!(PalettedTextures && mipmap >= 0 && trans == PNG_SOLID))
+    if (!(PalettedTextures && mipmap >= 0 && trans == GLPNG_SOLID))
         if (color == PNG_COLOR_TYPE_PALETTE)
             png_set_expand(png);
 
@@ -493,7 +493,7 @@
         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 
 #ifdef SUPPORTS_PALETTE_EXT
-        if (PalettedTextures && mipmap >= 0 && trans == PNG_SOLID && color == PNG_COLOR_TYPE_PALETTE) {
+        if (PalettedTextures && mipmap >= 0 && trans == GLPNG_SOLID && color == PNG_COLOR_TYPE_PALETTE) {
             png_colorp pal;
             int cols;
             GLint intf;
@@ -517,7 +517,7 @@
         }
         else
 #endif
-            if (trans == PNG_SOLID || trans == PNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA) {
+            if (trans == GLPNG_SOLID || trans == GLPNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA) {
                 GLenum glformat;
                 GLint glcomponent;
 
@@ -542,9 +542,9 @@
                         return 0;
                 }
 
-                if (mipmap == PNG_BUILDMIPMAPS)
+                if (mipmap == GLPNG_BUILDMIPMAPS)
                     Build2DMipmaps(glcomponent, width, height, glformat, data, 1);
-                else if (mipmap == PNG_SIMPLEMIPMAPS)
+                else if (mipmap == GLPNG_SIMPLEMIPMAPS)
                     Build2DMipmaps(glcomponent, width, height, glformat, data, 0);
                 else
                     glTexImage2D(GL_TEXTURE_2D, mipmap, glcomponent, width, height, 0, glformat, GL_UNSIGNED_BYTE, data);
@@ -574,13 +574,13 @@
 #define ALPHA *q
 
                 switch (trans) {
-                    case PNG_CALLBACK:
+                    case GLPNG_CALLBACK:
                         FORSTART
                             ALPHA = AlphaCallback((unsigned char) r, (unsigned char) g, (unsigned char) b);
                         FOREND
                             break;
 
-                    case PNG_STENCIL:
+                    case GLPNG_STENCIL:
                         FORSTART
                             if (r == StencilRed && g == StencilGreen && b == StencilBlue)
                                 ALPHA = 0;
@@ -589,48 +589,48 @@
                         FOREND
                             break;
 
-                    case PNG_BLEND1:
+                    case GLPNG_BLEND1:
                         FORSTART
                             a = r+g+b;
                         if (a > 255) ALPHA = 255; else ALPHA = a;
                         FOREND
                             break;
 
-                    case PNG_BLEND2:
+                    case GLPNG_BLEND2:
                         FORSTART
                             a = r+g+b;
                         if (a > 255*2) ALPHA = 255; else ALPHA = a/2;
                         FOREND
                             break;
 
-                    case PNG_BLEND3:
+                    case GLPNG_BLEND3:
                         FORSTART
                             ALPHA = (r+g+b)/3;
                         FOREND
                             break;
 
-                    case PNG_BLEND4:
+                    case GLPNG_BLEND4:
                         FORSTART
                             a = r*r+g*g+b*b;
                         if (a > 255) ALPHA = 255; else ALPHA = a;
                         FOREND
                             break;
 
-                    case PNG_BLEND5:
+                    case GLPNG_BLEND5:
                         FORSTART
                             a = r*r+g*g+b*b;
                         if (a > 255*2) ALPHA = 255; else ALPHA = a/2;
                         FOREND
                             break;
 
-                    case PNG_BLEND6:
+                    case GLPNG_BLEND6:
                         FORSTART
                             a = r*r+g*g+b*b;
                         if (a > 255*3) ALPHA = 255; else ALPHA = a/3;
                         FOREND
                             break;
 
-                    case PNG_BLEND7:
+                    case GLPNG_BLEND7:
                         FORSTART
                             a = r*r+g*g+b*b;
                         if (a > 255*255) ALPHA = 255; else ALPHA = (int) sqrt(a);
@@ -642,9 +642,9 @@
 #undef FOREND
 #undef ALPHA
 
-                if (mipmap == PNG_BUILDMIPMAPS)
+                if (mipmap == GLPNG_BUILDMIPMAPS)
                     Build2DMipmaps(4, width, height, GL_RGBA, data2, 1);
-                else if (mipmap == PNG_SIMPLEMIPMAPS)
+                else if (mipmap == GLPNG_SIMPLEMIPMAPS)
                     Build2DMipmaps(4, width, height, GL_RGBA, data2, 0);
                 else
                     glTexImage2D(GL_TEXTURE_2D, mipmap, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data2);
diff -rNu arbsrc_9167/GL/glpng/glpng.h arbsrc_9167.new/GL/glpng/glpng.h
--- arbsrc_9167/GL/glpng/glpng.h	2010-09-05 18:32:01.000000000 +0200
+++ arbsrc_9167.new/GL/glpng/glpng.h	2014-03-17 05:07:01.601597910 +0100
@@ -47,28 +47,28 @@
 #endif
 
     /* Mipmapping parameters */
-#define PNG_NOMIPMAPS      0 /* No mipmapping                        */
-#define PNG_BUILDMIPMAPS  -1 /* Calls a clone of gluBuild2DMipmaps() */
-#define PNG_SIMPLEMIPMAPS -2 /* Generates mipmaps without filtering  */
+#define GLPNG_NOMIPMAPS      0 /* No mipmapping                        */
+#define GLPNG_BUILDMIPMAPS  -1 /* Calls a clone of gluBuild2DMipmaps() */
+#define GLPNG_SIMPLEMIPMAPS -2 /* Generates mipmaps without filtering  */
 
     /* Who needs an "S" anyway? */
-#define PNG_NOMIPMAP     PNG_NOMIPMAPS
-#define PNG_BUILDMIPMAP  PNG_BUILDMIPMAPS
-#define PNG_SIMPLEMIPMAP PNG_SIMPLEMIPMAPS
+#define GLPNG_NOMIPMAP     GLPNG_NOMIPMAPS
+#define GLPNG_BUILDMIPMAP  GLPNG_BUILDMIPMAPS
+#define GLPNG_SIMPLEMIPMAP GLPNG_SIMPLEMIPMAPS
 
     /* Transparency parameters */
-#define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
-#define PNG_ALPHA     -2 /* Use alpha channel in PNG file, if there is one */
-#define PNG_SOLID     -1 /* No transparency                                */
-#define PNG_STENCIL    0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise       */
-#define PNG_BLEND1     1 /* a = r+g+b                                      */
-#define PNG_BLEND2     2 /* a = (r+g+b)/2                                  */
-#define PNG_BLEND3     3 /* a = (r+g+b)/3                                  */
-#define PNG_BLEND4     4 /* a = r*r+g*g+b*b                                */
-#define PNG_BLEND5     5 /* a = (r*r+g*g+b*b)/2                            */
-#define PNG_BLEND6     6 /* a = (r*r+g*g+b*b)/3                            */
-#define PNG_BLEND7     7 /* a = (r*r+g*g+b*b)/4                            */
-#define PNG_BLEND8     8 /* a = sqrt(r*r+g*g+b*b)                          */
+#define GLPNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
+#define GLPNG_ALPHA     -2 /* Use alpha channel in PNG file, if there is one */
+#define GLPNG_SOLID     -1 /* No transparency                                */
+#define GLPNG_STENCIL    0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise       */
+#define GLPNG_BLEND1     1 /* a = r+g+b                                      */
+#define GLPNG_BLEND2     2 /* a = (r+g+b)/2                                  */
+#define GLPNG_BLEND3     3 /* a = (r+g+b)/3                                  */
+#define GLPNG_BLEND4     4 /* a = r*r+g*g+b*b                                */
+#define GLPNG_BLEND5     5 /* a = (r*r+g*g+b*b)/2                            */
+#define GLPNG_BLEND6     6 /* a = (r*r+g*g+b*b)/3                            */
+#define GLPNG_BLEND7     7 /* a = (r*r+g*g+b*b)/4                            */
+#define GLPNG_BLEND8     8 /* a = sqrt(r*r+g*g+b*b)                          */
 
     typedef struct {
         unsigned int Width;
diff -rNu arbsrc_9167/RNA3D/RNA3D_Textures.cxx arbsrc_9167.new/RNA3D/RNA3D_Textures.cxx
--- arbsrc_9167/RNA3D/RNA3D_Textures.cxx	2010-09-05 18:32:00.000000000 +0200
+++ arbsrc_9167.new/RNA3D/RNA3D_Textures.cxx	2014-03-17 05:04:53.489971230 +0100
@@ -61,7 +61,7 @@
         pngInfo  info;
 
         // Using pngLoadAndBind to set texture parameters automatically.
-        texture[i] = pngBind(ImageFile, PNG_NOMIPMAP, PNG_ALPHA, &info, GL_CLAMP, GL_NEAREST, GL_NEAREST);
+        texture[i] = pngBind(ImageFile, GLPNG_NOMIPMAP, GLPNG_ALPHA, &info, GL_CLAMP, GL_NEAREST, GL_NEAREST);
 
         if (texture[i] == 0) {
             throw string(GBS_global_string("Error loading %s", ImageFile));

Reply via email to