Commit 88465e6
fmemopen.c: portability fix around funopen()
As noted in main.c, funopen() is used when fmemopen() is not available.
Unfortunately, funopen() is not portable and its definition is not
stable across Operating Systems (Darwin/macOS uses fpos_t while NetBSD
uses off_t).
This change fixes the build on NetBSD, where fpos_t is an opaque type
and does not support arithmetic. To be fair, even macOS' manual page for
funopen() mentions it erroneously assumes that fpos_t is an integral
type, and invites to read fseek(3) for a discussion of this issue.
Therefore, arguably the default should be off_t instead, but I did not
want to possibly break functionality anywhere else.1 parent 0ecdc0a commit 88465e6
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | | - | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
86 | | - | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
0 commit comments