Although CMake version 3.0.2 was previously required, the policies
CMP0053 and CMP0054, introduced only in CMake version 3.1 and used
in this CMakeLists file, can have surprising effects under an older
CMake version.
Simplify the CMakeLists file by setting the global policy version
to 3.1, and remove the specific policy settings.
As an added bonus, remove the vestigial workarounds for all ancient
CMake versions.
Only use libm on Unix and Unix-like systems, except for Apple (where
it's unnecessary), and BeOS and Haiku (where it's unavailable).
Avoid searching for libm at explicit locations. They may be incorrect,
especially for cross-platform builds.
As per the const correctness rules, top-level const-ness of data
in automatic scopes does not propagate outside of these scopes
(unlike const-ness at lower levels, such as pointers to const data).
Previously, const was used liberally, but inconsistently across the
libpng codebase. Using const wherever applicable is not incorrect.
However, _consistent_ use of const is difficult to maintain in such
conditions.
In conclusion, we shall continue to use const only where doing so is
strictly necessary:
1. If a function guarantees that it will not modify an argument
passed by pointer, the corresponding function parameter should be
a pointer-to-const (const T *).
2. Static data should not be modified, therefore it should be const.
Reference:
Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html#Use_of_const
In v1.6.0, compiler support for const became a requirement.
It should be used consistently. To maintain backwards compatibility,
PNG_CONST is still maintained in deprecated form.
Delete the files that are unused, redundant, or fundamentally broken:
def.c, makefile.bor, makefile.knr, makefile.msc, makefile.solaris-x86,
makefile.tc3
In v1.6.0, size_t became a required type. It should be used
consistently. To maintain backwards compatibility, png_size_t
is still maintained in deprecated form.