Style: Replace header guards with #pragma once

This commit is contained in:
Thaddeus Crews 2025-02-01 10:33:58 -06:00
parent 96fdaa616b
commit 324512e11c
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
1746 changed files with 1767 additions and 6920 deletions

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef CONDITION_VARIABLE_H
#define CONDITION_VARIABLE_H
#pragma once
#include "core/os/mutex.h"
#include "core/os/safe_binary_mutex.h"
@ -85,5 +84,3 @@ public:
};
#endif // THREADS_ENABLED
#endif // CONDITION_VARIABLE_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef KEYBOARD_H
#define KEYBOARD_H
#pragma once
#include "core/string/ustring.h"
@ -347,5 +346,3 @@ const char *keycode_get_name_by_index(int p_index);
char32_t fix_unicode(char32_t p_char);
Key fix_keycode(char32_t p_char, Key p_key);
Key fix_key_label(char32_t p_char, Key p_key);
#endif // KEYBOARD_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MAIN_LOOP_H
#define MAIN_LOOP_H
#pragma once
#include "core/input/input_event.h"
#include "core/object/gdvirtual.gen.inc"
@ -71,5 +70,3 @@ public:
MainLoop() {}
virtual ~MainLoop() {}
};
#endif // MAIN_LOOP_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MEMORY_H
#define MEMORY_H
#pragma once
#include "core/error/error_macros.h"
#include "core/templates/safe_refcount.h"
@ -244,5 +243,3 @@ public:
_FORCE_INLINE_ T *new_allocation(const Args &&...p_args) { return memnew(T(p_args...)); }
_FORCE_INLINE_ void delete_allocation(T *p_allocation) { memdelete(p_allocation); }
};
#endif // MEMORY_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MIDI_DRIVER_H
#define MIDI_DRIVER_H
#pragma once
#include "core/typedefs.h"
#include "core/variant/variant.h"
@ -110,5 +109,3 @@ public:
PackedStringArray get_connected_inputs() const;
};
#endif // MIDI_DRIVER_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MUTEX_H
#define MUTEX_H
#pragma once
#include "core/typedefs.h"
@ -127,5 +126,3 @@ using Mutex = MutexImpl;
using BinaryMutex = MutexImpl;
#endif // THREADS_ENABLED
#endif // MUTEX_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef OS_H
#define OS_H
#pragma once
#include "core/config/engine.h"
#include "core/io/logger.h"
@ -369,5 +368,3 @@ public:
OS();
virtual ~OS();
};
#endif // OS_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef RW_LOCK_H
#define RW_LOCK_H
#pragma once
#include "core/typedefs.h"
@ -102,5 +101,3 @@ public:
lock.write_unlock();
}
};
#endif // RW_LOCK_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef SAFE_BINARY_MUTEX_H
#define SAFE_BINARY_MUTEX_H
#pragma once
#include "core/error/error_macros.h"
#include "core/os/mutex.h"
@ -149,5 +148,3 @@ public:
};
#endif // THREADS_ENABLED
#endif // SAFE_BINARY_MUTEX_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef SEMAPHORE_H
#define SEMAPHORE_H
#pragma once
#include <cstdint>
@ -148,5 +147,3 @@ public:
};
#endif // THREADS_ENABLED
#endif // SEMAPHORE_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef SHARED_OBJECT_H
#define SHARED_OBJECT_H
#pragma once
#include "core/string/ustring.h"
#include "core/templates/vector.h"
@ -47,5 +46,3 @@ struct SharedObject {
SharedObject() {}
};
#endif // SHARED_OBJECT_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef SPIN_LOCK_H
#define SPIN_LOCK_H
#pragma once
#include "core/os/thread.h"
#include "core/typedefs.h"
@ -127,5 +126,3 @@ public:
};
#endif // THREADS_ENABLED
#endif // SPIN_LOCK_H

View file

@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "platform_config.h"
// Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h`
@ -40,9 +42,6 @@
#else
#ifndef THREAD_H
#define THREAD_H
#include "core/typedefs.h"
#ifdef THREADS_ENABLED
@ -208,6 +207,4 @@ public:
#endif // THREADS_ENABLED
#endif // THREAD_H
#endif // PLATFORM_THREAD_OVERRIDE

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef THREAD_SAFE_H
#define THREAD_SAFE_H
#pragma once
#include "core/os/mutex.h" // IWYU pragma: keep // Used in macro.
@ -40,5 +39,3 @@
bool is_current_thread_safe_for_nodes();
void set_current_thread_safe_for_nodes(bool p_safe);
#endif // THREAD_SAFE_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef TIME_H
#define TIME_H
#pragma once
#include "core/object/class_db.h"
#include "time_enums.h"
@ -83,5 +82,3 @@ public:
VARIANT_ENUM_CAST(Month);
VARIANT_ENUM_CAST(Weekday);
#endif // TIME_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef TIME_ENUMS_H
#define TIME_ENUMS_H
#pragma once
#include <cstdint>
@ -59,5 +58,3 @@ enum Weekday : uint8_t {
WEEKDAY_FRIDAY,
WEEKDAY_SATURDAY,
};
#endif // TIME_ENUMS_H