Make sure headers compile standalone

Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.

$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done

Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
This commit is contained in:
def 2020-09-26 10:23:33 +02:00
parent ee8872fb75
commit b178c7c74a
12 changed files with 45 additions and 0 deletions

View file

@ -2,9 +2,12 @@
#define ENGINE_CLIENT_BACKEND_SDL_H
#include "SDL.h"
#include "SDL_opengl.h"
#include "graphics_threaded.h"
#include <base/tl/threading.h>
#include <atomic>
#if defined(CONF_PLATFORM_MACOSX)

View file

@ -3,12 +3,29 @@
#ifndef ENGINE_CLIENT_CLIENT_H
#define ENGINE_CLIENT_CLIENT_H
#include <list>
#include <memory>
#include <base/hash.h>
#include <engine/client.h>
#include <engine/client/demoedit.h>
#include <engine/client/friends.h>
#include <engine/client/http.h>
#include <engine/client/serverbrowser.h>
#include <engine/client/updater.h>
#include <engine/editor.h>
#include <engine/engine.h>
#include <engine/graphics.h>
#include <engine/input.h>
#include <engine/map.h>
#include <engine/masterserver.h>
#include <engine/shared/config.h>
#include <engine/shared/demo.h>
#include <engine/shared/fifo.h>
#include <engine/shared/ghost.h>
#include <engine/shared/network.h>
#include <engine/sound.h>
#include <engine/steam.h>
#define CONNECTLINK "ddnet:"

View file

@ -3,6 +3,8 @@
#ifndef ENGINE_CLIENT_FRIENDS_H
#define ENGINE_CLIENT_FRIENDS_H
#include <engine/config.h>
#include <engine/console.h>
#include <engine/friends.h>
class CFriends : public IFriends

View file

@ -2,6 +2,7 @@
#define ENGINE_CLIENT_GRAPHICS_THREADED_H
#include <engine/graphics.h>
#include <engine/shared/config.h>
#include <vector>

View file

@ -3,6 +3,11 @@
#ifndef ENGINE_CLIENT_INPUT_H
#define ENGINE_CLIENT_INPUT_H
#include <engine/graphics.h>
#include <engine/input.h>
#include <stddef.h>
class CInput : public IEngineInput
{
IEngineGraphics *m_pGraphics;

View file

@ -3,8 +3,11 @@
#ifndef ENGINE_CLIENT_SERVERBROWSER_H
#define ENGINE_CLIENT_SERVERBROWSER_H
#include <engine/config.h>
#include <engine/external/json-parser/json.h>
#include <engine/masterserver.h>
#include <engine/serverbrowser.h>
#include <engine/shared/config.h>
#include <engine/shared/memheap.h>
class CServerBrowser : public IServerBrowser

View file

@ -3,7 +3,9 @@
#ifndef ENGINE_CLIENT_SOUND_H
#define ENGINE_CLIENT_SOUND_H
#include <engine/graphics.h>
#include <engine/sound.h>
#include <engine/storage.h>
#include "SDL.h"

View file

@ -3,6 +3,8 @@
#include "network.h"
#include <engine/console.h>
class CEcon
{
enum

View file

@ -3,6 +3,10 @@
#ifndef ENGINE_SHARED_FILECOLLECTION_H
#define ENGINE_SHARED_FILECOLLECTION_H
#include <engine/storage.h>
#include <stddef.h>
class CFileCollection
{
enum

View file

@ -1,6 +1,8 @@
#ifndef ENGINE_SHARED_NETBAN_H
#define ENGINE_SHARED_NETBAN_H
#include <engine/console.h>
#include <base/system.h>
inline int NetComp(const NETADDR *pAddr1, const NETADDR *pAddr2)

View file

@ -6,6 +6,8 @@
#include <winsock2.h>
#endif
#include <stddef.h>
int websocket_create(const char *addr, int port);
int websocket_destroy(int socket);
int websocket_recv(int socket, unsigned char *data, size_t maxsize, struct sockaddr_in *sockaddrbuf, size_t fromLen);

View file

@ -1,4 +1,6 @@
#ifndef ENGINE_UUID_H
#define ENGINE_UUID_H
#include <engine/shared/uuid_manager.h>
void RegisterGameUuids(CUuidManager *pManager);
#endif // ENGINE_UUID_H