-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Style: Integrate new #pragma once
syntax
#10756
base: master
Are you sure you want to change the base?
Conversation
630da6f
to
da33f97
Compare
``#ifdef``-based include guards | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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.
``#ifdef``-based include guards | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
``#ifndef``-based include guards | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Starting with 4.5, all files now use the ``#pragma once`` directive, as they | ||
improve readability and declutter macros. Use of ``#ifdef``-based include | ||
guards are now actively discouraged. |
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.
Starting with 4.5, all files now use the ``#pragma once`` directive, as they | |
improve readability and declutter macros. Use of ``#ifdef``-based include | |
guards are now actively discouraged. | |
Starting with Godot 4.5, all files now use the ``#pragma once`` directive, as they | |
improve readability and declutter macros. Use of ``#ifndef``-based include | |
guards are now actively discouraged. |
Both suggestions optional.
These are technically ifndef
-based not ifdef
-based, right? But maybe calling them colloquially "ifdef-based" still makes sense?
I know technically this is about changes in 4.5. But is there any reason not to have it in the 4.4 docs? I don't do coding for the engine so maybe I'm off here, but I wouldn't expect people to automatically assume they need to use the master branch for engine development. |
#pragma once
godot#102298With
#pragma once
being the new stylistic syntax utilized in the main repo, this aims to update the docs to reflect that