Skip to content

Commit

Permalink
Surpress deprecated unlink warning on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
finwo committed Feb 24, 2024
1 parent 13df785 commit a0ef815
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extern "C" {
#define write_os _write
#define read_os _read
#define close_os _close
#define unlink_os _unlink
#define O_CREAT _O_CREAT
#define O_RDWR _O_RDWR
#define OPENMODE (_S_IREAD | _S_IWRITE)
Expand All @@ -41,6 +42,7 @@ extern "C" {
#define write_os write
#define read_os read
#define close_os _close
#define unlink_os unlink
#define OPENMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
#else
#define stat_os stat64
Expand All @@ -50,6 +52,7 @@ extern "C" {
#define write_os write
#define read_os read
#define close_os _close
#define unlink_os unlink
#define OPENMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
#endif

Expand All @@ -67,7 +70,7 @@ void test_init() {
uint64_t alloc_7;

// Remove the file for this test
if (unlink(testfile)) {
if (unlink_os(testfile)) {
if (errno != ENOENT) {
perror("unlink");
}
Expand Down

0 comments on commit a0ef815

Please sign in to comment.