Update headers in lobby

Some gloox headers need workarounds to be included, so mark the header
"lib/external_libraries/gloox.h" as source for all gloox symbols and
collect all headers we use under it.

Further make include-what-you-use happy with files in source/lobby and
fix what needs to be fixed after.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-06-20 00:06:41 +02:00
parent 4720033ef9
commit b6e66a5d43
No known key found for this signature in database
8 changed files with 84 additions and 24 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -38,22 +38,33 @@
#pragma push_macro("lookup")
#undef lookup
#include <gloox/client.h>
#include <gloox/connectionlistener.h>
#include <gloox/error.h>
#include <gloox/glooxversion.h>
#include <gloox/jinglecontent.h>
#include <gloox/jingleiceudp.h>
#include <gloox/jinglesessionhandler.h>
#include <gloox/jinglesessionmanager.h>
#include <gloox/loghandler.h>
#include <gloox/message.h>
#include <gloox/mucroom.h>
#include <gloox/registration.h>
#include <gloox/registrationhandler.h>
#include <gloox/stanzaextension.h>
#include <gloox/tag.h>
#include <gloox/util.h>
#include <gloox/client.h> // IWYU pragma: export
#include <gloox/connectionlistener.h> // IWYU pragma: export
#include <gloox/delayeddelivery.h> // IWYU pragma: export
#include <gloox/disco.h> // IWYU pragma: export
#include <gloox/error.h> // IWYU pragma: export
#include <gloox/gloox.h> // IWYU pragma: export
#include <gloox/glooxversion.h> // IWYU pragma: export
#include <gloox/iq.h> // IWYU pragma: export
#include <gloox/iqhandler.h> // IWYU pragma: export
#include <gloox/jid.h> // IWYU pragma: export
#include <gloox/jinglecontent.h> // IWYU pragma: export
#include <gloox/jingleiceudp.h> // IWYU pragma: export
#include <gloox/jingleplugin.h> // IWYU pragma: export
#include <gloox/jinglesession.h> // IWYU pragma: export
#include <gloox/jinglesessionhandler.h> // IWYU pragma: export
#include <gloox/jinglesessionmanager.h> // IWYU pragma: export
#include <gloox/loghandler.h> // IWYU pragma: export
#include <gloox/message.h> // IWYU pragma: export
#include <gloox/messagehandler.h> // IWYU pragma: export
#include <gloox/mucroom.h> // IWYU pragma: export
#include <gloox/mucroomhandler.h> // IWYU pragma: export
#include <gloox/presence.h> // IWYU pragma: export
#include <gloox/registration.h> // IWYU pragma: export
#include <gloox/registrationhandler.h> // IWYU pragma: export
#include <gloox/stanzaextension.h> // IWYU pragma: export
#include <gloox/tag.h> // IWYU pragma: export
#include <gloox/util.h> // IWYU pragma: export
#pragma pop_macro("lookup")

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2013 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -19,5 +19,5 @@
#include "IXmppClient.h"
IXmppClient *g_XmppClient = NULL;
IXmppClient *g_XmppClient = nullptr;
bool g_rankedGame = false;

View file

@ -14,9 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "StanzaExtensions.h"
#include <list>
/******************************************************
* GameReport, fairly generic custom stanza extension used
* to report game statistics.

View file

@ -19,6 +19,7 @@
#include "lib/external_libraries/gloox.h"
#include <string>
#include <vector>
/// Global Gamelist Extension

View file

@ -18,21 +18,37 @@
#include "precompiled.h"
#include "XmppClient.h"
#include "StanzaExtensions.h"
#include "StanzaExtensions.h"
#include "i18n/L10n.h"
#include "lib/external_libraries/gloox.h"
#include "lib/utf8.h"
#include "network/NetServer.h"
#include "lobby/IXmppClient.h"
#include "network/NetClient.h"
#include "network/NetServer.h"
#include "network/StunClient.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/GUID.h"
#include "ps/Pyrogenesis.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/StructuredClone.h"
#include <iostream>
#include <iterator>
#include <js/GCAPI.h>
#include <js/PropertyAndElement.h>
#include <js/PropertyDescriptor.h>
#include <js/TracingAPI.h>
#include <memory>
#include <tuple>
#include <unicode/locid.h>
#include <unicode/utypes.h>
#include <utility>
//debug
#if 1

View file

@ -20,14 +20,21 @@
#include "IXmppClient.h"
#include "lib/code_annotation.h"
#include "lib/external_libraries/gloox.h"
#include "lib/types.h"
#include <ctime>
#include <deque>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <map>
#include <string>
#include <vector>
class ScriptRequest;
class JSTracer;
class ScriptInterface;
class XmppClient : public IXmppClient, public gloox::ConnectionListener, public gloox::MUCRoomHandler, public gloox::IqHandler, public gloox::RegistrationHandler, public gloox::MessageHandler, public gloox::Jingle::SessionHandler, public gloox::LogHandler
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -19,10 +19,17 @@
#include "lib/config2.h"
#if CONFIG2_LOBBY
#include "lib/external_libraries/gloox.h"
#include "lib/utf8.h"
#include "lobby/XmppClient.h"
#include "scriptinterface/ScriptConversions.h"
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <string>
class ScriptRequest;
template<> void Script::ToJSVal<gloox::Presence::PresenceType>(const ScriptRequest& rq, JS::MutableHandleValue ret, const gloox::Presence::PresenceType& val)
{
ToJSVal(rq, ret, XmppClient::GetPresenceString(val));

View file

@ -20,6 +20,10 @@
#include "JSInterface_Lobby.h"
#include "gui/GUIManager.h"
#include "lib/code_annotation.h"
#include "lib/code_generation.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/utf8.h"
#include "lobby/IXmppClient.h"
#include "network/NetServer.h"
@ -27,11 +31,21 @@
#include "ps/CStr.h"
#include "ps/Util.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptExceptions.h"
#include "scriptinterface/ScriptRequest.h"
#include "third_party/encryption/pkcs5_pbkdf2.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <sodium/core.h>
#include <sodium/crypto_hash_sha256.h>
#include <string>
class ScriptInterface;
namespace JS { class CallArgs; }
namespace JSI_Lobby
{
bool HasXmppClient()