Commit a1a9925
committed
[libc++] Guard fileno() and isatty() usage correctly.
See [1] and [2]. isatty() is part of unistd.h, but fileno() is in
stdio.h, and is guarded by `_POSIX_C_SOURCE >= 1` (on my machine,
`man 3 fileno` only requires `defined(_POSIX_C_SOURCE)`, though).
I ran into this issue while trying to compile libc++ for a bare metal
environment with Newlib as the libc. Newlib defines fileno() in stdio.h,
and its unistd.h does not include stdio.h.
[1]: https://linux.die.net/man/3/fileno
[2]: https://linux.die.net/man/3/isatty1 parent efe8573 commit a1a9925
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
0 commit comments