From 8e5b6f15c8a8b5cec3443149aae0147253180a41 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 5 Aug 2023 09:12:34 +0200 Subject: [PATCH] refactor: Remove use of mkdir(2) --- src/util/wincompat.hpp | 3 +-- unittest/test_util_DirEntry.cpp | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util/wincompat.hpp b/src/util/wincompat.hpp index e8c875d79..3aea7ab41 100644 --- a/src/util/wincompat.hpp +++ b/src/util/wincompat.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Joel Rosdahl and other contributors +// Copyright (C) 2021-2023 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -81,7 +81,6 @@ const mode_t S_IWUSR = mode_t(_S_IWRITE); // clang-format on # undef WIN32_NO_STATUS # include -# define mkdir(a, b) _mkdir(a) // Protect against incidental use of MinGW execv. # define execv(a, b) do_not_call_execv_on_windows diff --git a/unittest/test_util_DirEntry.cpp b/unittest/test_util_DirEntry.cpp index 044342aa8..a9426f4ae 100644 --- a/unittest/test_util_DirEntry.cpp +++ b/unittest/test_util_DirEntry.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,8 @@ using TestUtil::TestContext; using util::DirEntry; +namespace fs = util::filesystem; + namespace { bool @@ -317,7 +320,7 @@ TEST_CASE("Directory") { TestContext test_context; - REQUIRE(mkdir("directory", 0456) == 0); + REQUIRE(fs::create_directory("directory")); DirEntry entry("directory"); CHECK(entry); -- 2.47.2