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

[NFC][SYCL] Refactor OSUtils to use std::filesystem #16447

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Dec 20, 2024

For older gcc versions (< 8), use std::experimental::filesystem.

if (isPathPresent(Dir))
return 0;

// older GCC doesn't have full C++ 17 support.
Copy link
Contributor

Choose a reason for hiding this comment

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

is
"#if defined(__has_include) && __has_include()" really false for old gcc?
would it be better to use feature test macro? https://en.cppreference.com/w/cpp/feature_test#cpp_lib_filesystem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is
"#if defined(__has_include) && __has_include()" really false for old gcc?

Yes: https://godbolt.org/z/Wf3oMGMeG

would it be better to use feature test macro? https://en.cppreference.com/w/cpp/feature_test#cpp_lib_filesystem

I think we can not use feature test macro here. Because, cpp doc says:

Unlike the language feature test macros, they are not predefined. Instead, they are provided by the header <version>

For each library feature test macro, it is also provided by the headers that provide the relevant standard library components.

<version> header is available post C++ 20, so IIUC, it is not available with older compilers: https://en.cppreference.com/w/cpp/header/version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants