-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Deimplementing complications in libpng18 #659
base: libpng18
Are you sure you want to change the base?
Conversation
Remove #ifdef sections and other workarounds for old Windows compilers that lacked proper support for Win32, including, especially, support for the Win32 stdio API.
We should use `FILE *` instead of `FILE*` or `(FILE*)`, consistently, as we should for all other pointer types. Moreover, when we refer to standard stdio file objects in comments and in documentation, we should use the term "FILE objects" consistently. Lastly, we clarify in a comment in example.c that `PNG_STDIO_SUPPORTED` is true only when the stdio support is both available in the system and accessible in the user's libpng build.
The computer industry has spoken rather clearly: we shall have 8-bit bytes, powers-of-2- and multiples-of-8-bit ints and floats, one-size-fits-all pointers, and C API calling conventions for system-level interoperability between applications and libraries. So we're going to have all that and we're going to like it. Which we do. We use the opportunity to shed annotations and make libpng less baroque, both in interface and in implementation.
@jbowler I wanted to add you in as a reviewer, but you being in and out of this group resulted in me having to summon you hereby, because GitHub's "Reviewers" feature doesn't let me add you in there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Mostly copy edit so it should be fine if it compiles. I can't test the maybe-significant change which is the removal of PNGAPI/PNGCBAPI; they were always no-ops on the systems I use. PNGFAPI looks fine but I need to do a gh pr
pull and check the minconfigs; again any issues will be fail-to-compile, not some fundamental problem with the change.
The
The cmake build doesn't try to build it (I think you removed it), however it fails thus:
I.e. that pesky macro again. |
cmake is fixed by removing the three(?) spurious ";" characters from the end of the PNG_REMOVED macros in png.h. configure build is fixed by changing Makefile.am to refer to scripts/symbols.def, not scripts/pnglibconf/symbols.def. (Maybe none of the "symbols" stuff should be in scripts/pnglibconf, i.e. not symbols.c, checksym.awk but it looks like you intended symbols.def to be there too). The configure "make check" fails at pngtest-all, which is weird, but there is not corresponding cmake test so far as I can see. It fails on:
Because the error message that is emitted:
Doesn't seem to be found:
|
You removed STDERR from pngtest.c, so now the output does not go to stdout. EDIT: redirecting to stdout fixes the problem. |
With those changes (Makefile.am scripts.def, png.h PNG_REMOVED and tests/pngtest-all 2>&1 in TEST) the base builds all pass except for aarch64. The latter is not new; the assembler does not compile with -pedantic, from cmake:
It's the same in libpng-1.6, I've been ignoring it. |
The "minconfig" builds with configure seem to be as expected. The ones with cmake seem to have stopped working - it looks like everything gets built. |
cmake "minconfig" builds seem consistent too; I had typo'ed (or probably edito'ed) DFA_XTRA to DFA_XTA on the command line for cmake. I did notice that despite setting 'VERBOSE=1' on the corresponding "make" the cmake sub-command doesn't seem to generate any output - the cmake for OUTPUT=pnglibconf.h is recorded in the log file but not the executed commands. |
My three fixes are in #660 |
Here are three honking commits for your viewing and reviewing pleasure.
FYI, projects/owatcom and scripts/makefile.intel are about to go, because they depend on what I'm about to remove in this PR. And I could fix those but I ain't gonna. And CMake should be able to do their job, anyway. I haven't tested Open Watcom recently, but last time I did give it a try, about two years ago, its IDE died a horrible death when I attempted to do stuff with projects/owatcom on my Windows 10 laptop.
Also about Watcom: fun fact: I used to live and work in Waterloo, Ontario for aboot a decade, and two former Watcom compiler engineers used to be in my team at BlackBerry for a while. Because, you know... Waterloo... compiler... wink-wink 😉