Style: Harmonize header includes in modules

This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
This commit is contained in:
Rémi Verschelde
2023-06-13 16:56:21 +02:00
parent 7734146060
commit 25b2f1780a
217 changed files with 572 additions and 415 deletions

View File

@@ -30,25 +30,25 @@
#include "crypto_mbedtls.h"
#include "core/io/file_access.h"
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"
#include "core/io/file_access.h"
#include "core/os/os.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_settings.h"
#endif
#define PEM_BEGIN_CRT "-----BEGIN CERTIFICATE-----\n"
#define PEM_END_CRT "-----END CERTIFICATE-----\n"
#define PEM_MIN_SIZE 54
#include <mbedtls/debug.h>
#include <mbedtls/md.h>
#include <mbedtls/pem.h>
#define PEM_BEGIN_CRT "-----BEGIN CERTIFICATE-----\n"
#define PEM_END_CRT "-----END CERTIFICATE-----\n"
#define PEM_MIN_SIZE 54
CryptoKey *CryptoKeyMbedTLS::create() {
return memnew(CryptoKeyMbedTLS);
}

View File

@@ -29,6 +29,7 @@
/**************************************************************************/
#include "dtls_server_mbedtls.h"
#include "packet_peer_mbed_dtls.h"
Error DTLSServerMbedTLS::setup(Ref<TLSOptions> p_options) {

View File

@@ -31,9 +31,10 @@
#ifndef DTLS_SERVER_MBEDTLS_H
#define DTLS_SERVER_MBEDTLS_H
#include "core/io/dtls_server.h"
#include "tls_context_mbedtls.h"
#include "core/io/dtls_server.h"
class DTLSServerMbedTLS : public DTLSServer {
private:
static DTLSServer *_create_func();

View File

@@ -31,9 +31,10 @@
#ifndef PACKET_PEER_MBED_DTLS_H
#define PACKET_PEER_MBED_DTLS_H
#include "core/io/packet_peer_dtls.h"
#include "tls_context_mbedtls.h"
#include "core/io/packet_peer_dtls.h"
#include <mbedtls/timing.h>
class PacketPeerMbedDTLS : public PacketPeerDTLS {

View File

@@ -31,9 +31,10 @@
#ifndef STREAM_PEER_MBEDTLS_H
#define STREAM_PEER_MBEDTLS_H
#include "core/io/stream_peer_tls.h"
#include "tls_context_mbedtls.h"
#include "core/io/stream_peer_tls.h"
class StreamPeerMbedTLS : public StreamPeerTLS {
private:
Status status = STATUS_DISCONNECTED;

View File

@@ -30,7 +30,8 @@
#include "test_crypto_mbedtls.h"
#include "modules/mbedtls/crypto_mbedtls.h"
#include "../crypto_mbedtls.h"
#include "tests/test_macros.h"
namespace TestCryptoMbedTLS {

View File

@@ -34,7 +34,6 @@
#include "crypto_mbedtls.h"
#include "core/io/file_access.h"
#include "core/object/ref_counted.h"
#include <mbedtls/config.h>