Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libpng16] build: Rename a private function to benefit C++Builder
Embarcadero's compilers, old (Borland-based) and new (Clang-based), do have full support for Standard C. The Clang-based compiler is claiming, through the macro __STDC_VERSION__, to support C99 and C11, whereas the Borland-based compiler supports ANSI C, as it has for decades. However, their run-time library is exposing global functions beyond the scope of Standard C, for backwards compatibility with the older Borland products. One of these functions is `randomize`, which clashes with a function inside pngvalid.c that incidentally has the same name. Building libpng in "Strict ANSI C" mode, in which all Borland-specific globals are hidden (e.g. via `bcc32 -A`), would have been a workable solution for the Borland-based ANSI C compiler, but no such solution appears to exist for the Clang-based C90/C99/C11 compiler. Fortunately, renaming a private function inside a test program is a cost-free alternative fix. This is a cherry-pick of commit 6184164 from branch 'libpng18'.
- Loading branch information