|
506 | 506 | # define png_aligncastconst(type, value) ((const void*)(value))
|
507 | 507 | #endif /* __cplusplus */
|
508 | 508 |
|
509 |
| -#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ |
510 |
| - defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) |
| 509 | +#if defined(PNG_FLOATING_POINT_SUPPORTED) || defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) |
511 | 510 | /* png.c requires the following ANSI-C constants if the conversion of
|
512 | 511 | * floating point to ASCII is implemented therein:
|
513 | 512 | *
|
514 | 513 | * DBL_DIG Maximum number of decimal digits (can be set to any constant)
|
515 | 514 | * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
|
516 | 515 | * DBL_MAX Maximum floating point number (can be set to an arbitrary value)
|
517 | 516 | */
|
| 517 | + |
518 | 518 | # include <float.h>
|
519 | 519 |
|
520 |
| -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ |
521 |
| - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) |
| 520 | + /* Handle floating-point headers depending on the platform */ |
| 521 | +# if ((defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ |
| 522 | + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)) && \ |
| 523 | + !(defined(__APPLE__) && defined(__MACH__)) // this if block gets executed for older macOS versions |
522 | 524 | /* We need to check that <math.h> hasn't already been included earlier
|
523 | 525 | * as it seems it doesn't agree with <fp.h>, yet we should really use
|
524 | 526 | * <fp.h> if possible.
|
525 | 527 | */
|
526 | 528 | # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
|
527 | 529 | # include <fp.h>
|
528 | 530 | # endif
|
529 |
| -# else |
| 531 | +# else // this if block gets executed for newer macOS versions(Ventura/Sonoma/Sequoia) OR other platforms |
| 532 | + /* if (defined(__APPLE__) && defined(__MACH__)) or other cases */ |
| 533 | + /* Include math.h for macOS and all other platforms */ |
530 | 534 | # include <math.h>
|
531 | 535 | # endif
|
| 536 | + |
532 | 537 | # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
533 | 538 | /* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
534 | 539 | * MATH=68881
|
535 | 540 | */
|
536 | 541 | # include <m68881.h>
|
537 | 542 | # endif
|
| 543 | + |
538 | 544 | #endif
|
539 | 545 |
|
540 | 546 | /* This provides the non-ANSI (far) memory allocation routines. */
|
|
0 commit comments