Skip to content

Commit

Permalink
pngcrush: Fix build with recent clang
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandesign committed Feb 5, 2025
1 parent 18e2142 commit de689eb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphics/pngcrush/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ use_xz yes
checksums rmd160 ff93938e8e6ba8565386efdb51962f16b138a27d \
sha256 8fc18bcbcc65146769241e20f9e21e443b0f4538d581250dce89b1e969a30705

patchfiles patch-Makefile.diff
patchfiles patch-Makefile.diff \
patch-pngpriv.h.diff

# cannot use SSE includes on snowleopard, #52419
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
Expand Down
26 changes: 26 additions & 0 deletions graphics/pngcrush/files/patch-pngpriv.h.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Fix:

fatal error: 'fp.h' file not found

https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24
--- pngpriv.h.orig 2017-08-29 16:01:23.000000000 -0500
+++ pngpriv.h 2025-02-05 09:56:47.000000000 -0600
@@ -508,18 +508,7 @@
*/
# include <float.h>

-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- 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)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881

0 comments on commit de689eb

Please sign in to comment.