Giter Club home page Giter Club logo

Comments (7)

richardgv avatar richardgv commented on August 16, 2024

Huh, I remember I once saw the issue bug but has already fixed it somewhere, and I couldn't reproduce it now anyway... Huh, could please check if the problem is there with my WIP patch?

from skippy-xd.

b3nmore avatar b3nmore commented on August 16, 2024

Patched version won't build (unpatched does):

In file included from src/img-png.c:1:0:
src/img-png.c: In function ‘spng_read’:
src/img-png.c:38:28: error: ‘png_const_bytep’ undeclared (first use in this function)
if (unlikely(png_sig_cmp((png_const_bytep) sig, 0, SPNG_SIGBYTES))) {
^
src/skippy.h:314:42: note: in definition of macro ‘unlikely’
#define unlikely(x) __builtin_expect(!!(x), 0)
^
src/img-png.c:38:28: note: each undeclared identifier is reported only once for each function it appears in
if (unlikely(png_sig_cmp((png_const_bytep) sig, 0, SPNG_SIGBYTES))) {
^
src/skippy.h:314:42: note: in definition of macro ‘unlikely’
#define unlikely(x) __builtin_expect(!!(x), 0)
^
src/img-png.c:38:45: error: expected ‘)’ before ‘sig’
if (unlikely(png_sig_cmp((png_const_bytep) sig, 0, SPNG_SIGBYTES))) {
^
src/skippy.h:314:42: note: in definition of macro ‘unlikely’
#define unlikely(x) __builtin_expect(!!(x), 0)
^
src/img-png.c:38:45: error: too few arguments to function ‘png_sig_cmp’
if (unlikely(png_sig_cmp((png_const_bytep) sig, 0, SPNG_SIGBYTES))) {
^
src/skippy.h:314:42: note: in definition of macro ‘unlikely’
#define unlikely(x) __builtin_expect(!!(x), 0)
^
In file included from /usr/include/libpng12/png.h:538:0,
from src/img-png.c:2:
/usr/include/libpng12/png.h:1594:23: note: declared here
extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
^
/usr/include/libpng12/pngconf.h:1523:58: note: in definition of macro ‘PNG_EXPORT’

define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol

                                                      ^

src/img-png.c:86:2: warning: implicit declaration of function ‘png_set_alpha_mode’ [-Wimplicit-function-declaration]
png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, 1.0);
^
src/img-png.c:86:30: error: ‘PNG_ALPHA_STANDARD’ undeclared (first use in this function)
png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, 1.0);
^
make: *** [img-png.o] Error 1

from skippy-xd.

b3nmore avatar b3nmore commented on August 16, 2024

Sorry hit the wrong button .....

from skippy-xd.

richardgv avatar richardgv commented on August 16, 2024

You are building with libpng-1.2, which is absurdly old and shouldn't be used on modern systems (it's mostly only used by some closed-source apps). I've updated my patch to (hopefully) fix the issue.

from skippy-xd.

b3nmore avatar b3nmore commented on August 16, 2024

You are building with libpng-1.2, which ...

AFAIK libpng has two official branches, 1.6 and 1.2, and both, Debian unstable and the Ubuntu development release are using the 1.2.

Still no luck building with the updated patch:

In file included from /usr/include/libpng12/png.h:538:0,
                 from src/img-png.c:2:
/usr/include/libpng12/pngconf.h:371:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
            __pngconf.h__ in libpng already includes setjmp.h;
                     ^
/usr/include/libpng12/pngconf.h:372:12: error: unknown type name ‘__dont__’
            __dont__ include it again.;
            ^
/usr/include/libpng12/pngconf.h:372:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘it’
            __dont__ include it again.;
                             ^
/usr/include/libpng12/pngconf.h:372:29: error: unknown type name ‘it’
make: *** [img-png.o] Error 1

from skippy-xd.

richardgv avatar richardgv commented on August 16, 2024

AFAIK libpng has two official branches, 1.6 and 1.2, and both, Debian unstable and the Ubuntu development release are using the 1.2.

Oh, I'm truly sorry. All the distros I use (Gentoo (libpng-1.2.50 in portage tree for compatiblity with closed-source apps, doesn't install header files), Arch (libpng12 in community repo), FreeBSD (does it have libpng-1.2 in ports tree?)) are using libpng-1.5/1.6 system-wide, so I thought 1.2 is already no longer in wide use...

Now, looks like it's the 10-th or 20-th time Debian/Ubuntu gives me troubles with crazy libraries versions...

Still no luck building with the updated patch:

Oh, I see. I thought it's only a problem on my side. FreeType is including setjmp.h as well, and libpng-1.2 somehow doesn't like it (but libpng-1.6.2 doesn't complain). A workaround is to define PNG_SKIP_SETJMP_CHECK. I've updated the patch to (hopefully) fix the issue.

from skippy-xd.

b3nmore avatar b3nmore commented on August 16, 2024

The last change did it. I can build now the patched version an it fixes the issue. Thanks.

from skippy-xd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.