Skip to content

Commit fcf9364

Browse files
deftioclaude
andcommitted
Fix CI: add _POSIX_C_SOURCE for fileno, remove duplicate link
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6487ca5 commit fcf9364

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tools/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ add_executable(generate_fixtures generate_fixtures.c)
1010
target_link_libraries(generate_fixtures PRIVATE triepack_core)
1111

1212
add_executable(trp trp_inspect.c)
13-
target_link_libraries(trp PRIVATE triepack_core triepack_json)
13+
target_link_libraries(trp PRIVATE triepack_json)
1414
install(TARGETS trp DESTINATION ${CMAKE_INSTALL_BINDIR})
1515

1616
# Custom target to generate test fixtures

tools/trp_inspect.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
* BSD-2-Clause -- see LICENSE.txt
2121
*/
2222

23+
/* Expose POSIX isatty/fileno under strict C99 (must precede all includes) */
24+
#ifndef _WIN32
25+
#define _POSIX_C_SOURCE 200809L
26+
#include <unistd.h>
27+
#endif
28+
2329
#include "triepack/triepack.h"
2430
#include "triepack/triepack_json.h"
2531

@@ -32,8 +38,6 @@
3238
#include <io.h>
3339
#define isatty _isatty
3440
#define fileno _fileno
35-
#else
36-
#include <unistd.h>
3741
#endif
3842

3943
/* ── ANSI colour helpers ─────────────────────────────────────────────── */

0 commit comments

Comments
 (0)