mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Fix unused platform check and configuration for macOS
In a similar manner as zlib (https://github.com/madler/zlib/pull/895), libpng contains a header configuration that's no longer valid and hasn't been exercised for the macOS target. - The target OS conditional macros are misused. Specifically `TARGET_OS_MAC` covers all Apple targets, including iOS, and it should not be checked with `#if defined` as they would always be defined (to either 1 or 0) on Apple platforms. - `#include <fp.h>` no longer works for the macOS target and results in a compilation failure. macOS ships all required functions in `math.h`, and clients should use `math.h` instead. This problem has not been noticed until a recent extension in clang (https://github.com/llvm/llvm-project/pull/74676) exposed the issue and broke libpng builds on Apple platforms. The failure can be reproduced now by adding `#include <TargetConditionals.h>` before the block. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
parent
7ec2bd28c7
commit
893b8113f0
2
AUTHORS
2
AUTHORS
@ -33,6 +33,8 @@ Authors, for copyright and licensing purposes.
|
|||||||
* Vadim Barkov
|
* Vadim Barkov
|
||||||
* Willem van Schaik
|
* Willem van Schaik
|
||||||
* Zhijie Liang
|
* Zhijie Liang
|
||||||
|
* Apple Inc.
|
||||||
|
- Zixu Wang
|
||||||
* Arm Holdings
|
* Arm Holdings
|
||||||
- Richard Townsend
|
- Richard Townsend
|
||||||
* Google Inc.
|
* Google Inc.
|
||||||
|
14
pngpriv.h
14
pngpriv.h
@ -556,18 +556,8 @@
|
|||||||
*/
|
*/
|
||||||
# include <float.h>
|
# include <float.h>
|
||||||
|
|
||||||
# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
|
# include <math.h>
|
||||||
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
|
|
||||||
/* We need to check that <math.h> hasn't already been included earlier
|
|
||||||
* as it seems it doesn't agree with <fp.h>, yet we should really use
|
|
||||||
* <fp.h> if possible.
|
|
||||||
*/
|
|
||||||
# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
|
|
||||||
# include <fp.h>
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# include <math.h>
|
|
||||||
# endif
|
|
||||||
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
||||||
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
||||||
* MATH=68881
|
* MATH=68881
|
||||||
|
Loading…
x
Reference in New Issue
Block a user