This avoids warnings on clang-16 such as:
getopt/getopt.c:315:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
exchange (argv)
^
* Do not make empty man pages, use either pandoc or prebuild
A check is added to configure whether flac.1 and metaflac.1
are already build when pandoc is not available. This is the
case in for example dist packages
* Fix typo in new automake conditional
Because of issue https://github.com/xiph/flac/issues/437 compiler
flags are prepended instead of appended, so the user can override
them without altering the CMakeLists.txt.
Also, Clang doesn't support per-function optimize options, so in
CMake the fma file gets that option per-file. This is not supported
by automake.
cmake uses $(datadir}/cmake and $(libdir}/cmake as base path to
search for its moduels. Install FLAC cmake module in
$(libdir}/cmake/FLAC because it provides arch dependent API/ABI.
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
As CPU_IS_LITTLE_ENDIAN is used nowehere except in test_libflac,
switch to CPU_IS_BIG_ENDIAN instead, which is actually used in the
code at several places. CMake didn't set the former but does set
the latter.
Tool documentation has moved to man directory, other dev docs to
README.md and CONTRIBUTING.md. User documentation is already on
the website and doesn't really belong in the source code. Also, fix CMake
so that it uses Doxyfile.in instead of using defaults.
This adds a dump of current ABIs (which will probably be released
as 1.4.0) to the test directory, and adds a comparison to current
ABIs to the distcheck
For now OOM emulation in fuzzer_metadata is disabled, as I really
want to get as much merged as soon as possible. Need to get back
to this at some point
For some reason realloc failing to allocate space to store the
results of entropy partitioning was not handled at all. The realloc
is moved to a spot where it is possible to set encoder state. This
also moves it from deep within a loop to being called only
occasionally
Parts of the code use realloc like
x = safe_realloc(x, somesize);
when this is the case, the safe_realloc variant used must free the
old memory block in case it fails, otherwise it will leak. However,
there are also instances in the code where handling is different:
if (0 == (x = safe_realloc(y, somesize)))
return false
in this case, y should not be freed, as y is not set to NULL we
could encounter double frees. Here the safe_realloc_nofree
functions are used.