Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: replace kPathSeparator with std::filesystem #53063

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented May 20, 2024

We don't need kPathSeparator anymore since std::filesystem::path::preferred_separator exists.

cc @nodejs/cpp-reviewers @nodejs/fs

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 20, 2024
src/path.cc Outdated Show resolved Hide resolved
src/path.cc Outdated Show resolved Hide resolved
src/path.h Outdated Show resolved Hide resolved
@@ -13,6 +13,7 @@
#include <unistd.h>
#endif

#include <filesystem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems wrong to include a header without using it in the file. Shouldn't it be included in node_report.cc ?

@@ -3,6 +3,7 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <filesystem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -7,6 +7,7 @@
#error("This header can only be used when inspector is enabled")
#endif

#include <filesystem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -57,6 +57,7 @@
#include <array>
#include <atomic>
#include <cstdint>
#include <filesystem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -4,6 +4,7 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <cinttypes>
#include <filesystem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@targos
Copy link
Member

targos commented May 28, 2024

Error on Windows:

D:\a\node\node\src\compile_cache.cc(208,47): error C2676: binary '+': 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator [D:\a\node\node\libnode.vcxproj]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants