Skip to content

Commit 5c83226

Browse files
author
chuck
committed
pdflib-lite: macosx: include math.h rather than deprecated fp.h
On a mac the bundled png file libs/png/pngconf.h may attempt to include the deprecated <fp.h> file in some cases (should fail with a fatal file not found error). This is controlled by the "MACOS" define in pngconf.h (note that "MACOSX" is defined elsewhere... "MACOS" only appears in pngconf.h). On MACOSX we can include <math.h> instead of <fp.h> to avoid the fatal error. (when compiling on my older macbook I found that "MACOS" was not getting defined because TARGET_OS_MAC was not define, so it did not attempt to include fp.h and fail. compiling on my newer macbook does get the error.)
1 parent 8ead779 commit 5c83226

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

print/pdflib-lite/distinfo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$NetBSD: distinfo,v 1.10 2025/02/21 17:08:52 chuck Exp $
1+
$NetBSD: distinfo,v 1.11 2026/02/07 20:25:53 chuck Exp $
22

33
BLAKE2s (PDFlib-Lite-7.0.5.tar.gz) = f36b99aabd80c0db3b5582957550628317a4ea35da237faee1ad81a322c126e6
44
SHA512 (PDFlib-Lite-7.0.5.tar.gz) = d3c409ebf4a53ec1886762307b7772f71ba8db96d2caab3e2477278d4c9875bf163dbd6b12cc6a2270d4482e06b1b1d4d5cb51753bd8754f4f8736c5e4300c22
@@ -8,3 +8,4 @@ SHA1 (patch-ab) = 080be19dbb3d4ca317bca6f92c675aea2a685594
88
SHA1 (patch-config_aclocal.m4) = 357b2a276ae70c3f9fc1a0ff0bd0ca65cc4d6e5c
99
SHA1 (patch-configure) = 974c729a970e5b5af199007f022cdb11783c380c
1010
SHA1 (patch-libs_pdcore_pc_config.h) = e68f27744119facb7b0d7b54fb5104fe1373354d
11+
SHA1 (patch-libs_png_pngconf.h) = fd4202e14b8b14180b7c767e326dd33d6d0c785b
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$NetBSD: patch-libs_png_pngconf.h,v 1.1 2026/02/07 20:25:53 chuck Exp $
2+
3+
On MACOSX: Include <math.h> instead of attempting to include
4+
deprecated <fp.h> (and getting a "fatal error: 'fp.h' file not found" err).
5+
6+
--- libs/png/pngconf.h.orig 2026-02-07 19:53:11.137655172 +0000
7+
+++ libs/png/pngconf.h
8+
@@ -297,9 +297,9 @@
9+
10+
/* Try to determine if we are compiling on a Mac. Note that testing for
11+
* just __MWERKS__ is not good enough, because the Codewarrior is now used
12+
- * on non-Mac platforms.
13+
+ * on non-Mac platforms. Not necessary on MACOSX.
14+
*/
15+
-#ifndef MACOS
16+
+#if !defined(MACOS) && !defined(MACOSX)
17+
# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
18+
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
19+
# define MACOS

0 commit comments

Comments
 (0)