Godot version:
master build https://github.com/godotengine/godot/commit/ae28c0fdb8f22dc26339e9f81b555e129f61b010
OS/device including version:
Any
Issue description:
As detected by LGTM, there are currently 55 files without header guards. Many of them seem to be register_types.h. A helpful list by Akein can be found here.
I think we should add missing #include guards in all files that are missing it.
Because missing both #pragma once and #include guard seems to be more concerning matter compared to choosing between them.
Also, if and when we do decide to change it, we can just guardonce tools to convert between them.
Related: #18143 (where I have mentioned this before).
Note: #36324 is also part of this. I created this issue as there wasn't an issue for all concerned files.
Steps to reproduce:
Visit https://lgtm.com/projects/g/godotengine/godot/alerts?mode=list&id=cpp%2Fmissing-header-guard.
Hey @Anutrix, I can take care of this. For the multiple instances of register_types.h files missing include guards, do you suggest prefixing the macro names with the name of the parent directory to maintain uniqueness? For example:
#ifndef WEBSOCKET_REGISTER_TYPES_H
#define WEBSOCKET_REGISTER_TYPES_H
for root/modules/websocket/register_types.h and
#ifndef ANDROID_EXPORT_H
#define ANDROID_EXPORT_H
for root/platform/android/export/export.h
@RajatGoswami That seems like a good solution yes.
Thanks! I've created a PR here for the requested changes: https://github.com/godotengine/godot/pull/37219
Fixed by #37219.
Most helpful comment
@RajatGoswami That seems like a good solution yes.