-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Change #pragma once to include guards. #2372
Change #pragma once to include guards. #2372
Conversation
Libc++ uses include guards instead of #pragma once. This change makes it easier for libc++ to sync with MSVC STL.
@StephanTLavavej As discussed privately on Discord here the PR for the charconv tests. |
@@ -1,7 +1,8 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |||
|
|||
#pragma once | |||
#ifndef TEST_HPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filename is quite short to the include guard isn't too unique.
Since MSVC STL uses #pragma once in their other tests there's no conflict with the other test.hpp files.
At libc++'s side and it's no issue there.
Are you happy with this short name or should I include the directory name? In that case I think it makes sense to do that to all files just to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very short, but I didn't complain since the scope of these headers is just this single test. If test.hpp
is a sufficiently-descriptive name, then TEST_HPP
is almost certainly a sufficiently-unique header guard macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine by me. I wanted to point out this short name so it the attention of the reviewers. Thanks for the review!
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for increasing the alignment of our codebases, and for your heroic efforts to add floating-point |
Libc++ uses include guards instead of #pragma once. This change
makes it easier for libc++ to sync with MSVC STL.