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

Style: Integrate new #pragma once syntax #10756

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

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Mar 10, 2025

With #pragma once being the new stylistic syntax utilized in the main repo, this aims to update the docs to reflect that

@Repiteo Repiteo added enhancement topic:codestyle content:example code Issues and PRs involving code examples labels Mar 10, 2025
@Repiteo Repiteo force-pushed the style/pragma-once branch from 630da6f to da33f97 Compare March 10, 2025 14:56
Comment on lines +97 to +98
``#ifdef``-based include guards
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
``#ifdef``-based include guards
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``#ifndef``-based include guards
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment on lines +100 to +102
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:example code Issues and PRs involving code examples enhancement topic:codestyle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants