Skip to content

Commit 3a37e64

Browse files
committed
Get rid of <unistd.h> include.
* tests/test_file.c (main): - Replace unlink() calls with remove() from <stdio.h> and drop <unistd.h> include, fixing build issue on Windows. Addressing Windows build issue differently from what proposed by @fanc999 in pull request #15. Thanks @fanc999 for first raising this.
1 parent 90b8802 commit 3a37e64

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2021-01-22 Theppitak Karoonboonyanan <[email protected]>
2+
3+
Get rid of <unistd.h> include.
4+
5+
* tests/test_file.c (main):
6+
- Replace unlink() calls with remove() from <stdio.h> and drop
7+
<unistd.h> include, fixing build issue on Windows.
8+
9+
Addressing Windows build issue differently from what proposed by
10+
@fanc999 in pull request #15. Thanks @fanc999 for first raising this.
11+
112
2021-01-15 Theppitak Karoonboonyanan <[email protected]>
213

314
Use TRIE_CHAR_TERM in TAIL I/O methods.

tests/test_file.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "utils.h"
2929
#include <stdio.h>
3030
#include <wchar.h>
31-
#include <unistd.h>
3231

3332
#define TRIE_FILENAME "test.tri"
3433

@@ -79,7 +78,7 @@ main (void)
7978

8079
/* save & close */
8180
msg_step ("Saving trie to file");
82-
unlink (TRIE_FILENAME); /* error ignored */
81+
remove (TRIE_FILENAME); /* error ignored */
8382
if (trie_save (test_trie, TRIE_FILENAME) != 0) {
8483
printf ("Failed to save trie to file '%s'.\n", TRIE_FILENAME);
8584
goto err_trie_created;
@@ -116,12 +115,12 @@ main (void)
116115
goto err_trie_saved;
117116
}
118117

119-
unlink (TRIE_FILENAME);
118+
remove (TRIE_FILENAME);
120119
trie_free (test_trie);
121120
return 0;
122121

123122
err_trie_saved:
124-
unlink (TRIE_FILENAME);
123+
remove (TRIE_FILENAME);
125124
err_trie_created:
126125
trie_free (test_trie);
127126
err_trie_not_created:

0 commit comments

Comments
 (0)