Skip to content

Commit 8349f81

Browse files
committed
Fix Windows build: guard symlink() call with #ifndef _WIN32
The SKIP() macro returns at runtime but the compiler still sees the undeclared symlink() function. Use #else to hide the entire body.
1 parent 1b84943 commit 8349f81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_discover.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,10 @@ TEST(discover_cbmignore_stacks) {
466466

467467
TEST(discover_symlink_skipped) {
468468
#ifdef _WIN32
469-
/* Symlinks require elevated privileges on Windows — skip */
469+
/* Symlinks require elevated privileges on Windows — skip.
470+
* Guard the entire body: symlink() doesn't exist on Windows. */
470471
SKIP("symlinks need admin on Windows");
471-
#endif
472+
#else
472473
char *base = th_mktempdir("cbm_disc_sym");
473474
ASSERT(base != NULL);
474475

@@ -499,6 +500,7 @@ TEST(discover_symlink_skipped) {
499500
cbm_discover_free(files, count);
500501
th_cleanup(base);
501502
PASS();
503+
#endif
502504
}
503505

504506
TEST(discover_new_ignore_patterns) {

0 commit comments

Comments
 (0)