From 67a11a5776dcd849215d26d6fdaacd43429776b6 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 4 Oct 2009 20:00:56 +0000 Subject: [PATCH] (svn r17699) -Codechange: move #ifdef ENABLE_NETWORK till after the 'generic' includes so compilation without network support doesn't get broken as easily by changes in header files --- src/network/core/address.h | 4 ++-- src/network/core/core.h | 4 ++-- src/network/core/game.h | 4 ++-- src/network/core/packet.h | 4 ++-- src/network/core/tcp.h | 4 ++-- src/network/core/tcp_content.h | 4 ++-- src/network/core/tcp_game.h | 4 ++-- src/network/core/udp.h | 4 ++-- src/network/network_content.h | 4 ++-- src/network/network_func.h | 4 ++-- src/network/network_gui.h | 4 ++-- src/network/network_internal.h | 4 ++-- src/network/network_type.h | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/network/core/address.h b/src/network/core/address.h index 72631220ca..6385c5d02a 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -12,13 +12,13 @@ #ifndef NETWORK_ADDRESS_H #define NETWORK_ADDRESS_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "config.h" #include "../../string_func.h" #include "../../core/smallmap_type.hpp" +#ifdef ENABLE_NETWORK + class NetworkAddress; typedef SmallVector NetworkAddressList; typedef SmallMap SocketList; diff --git a/src/network/core/core.h b/src/network/core/core.h index c14bc83a9d..a47ebff87f 100644 --- a/src/network/core/core.h +++ b/src/network/core/core.h @@ -14,11 +14,11 @@ #ifndef NETWORK_CORE_H #define NETWORK_CORE_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "../../newgrf_config.h" +#ifdef ENABLE_NETWORK + bool NetworkCoreInitialize(); void NetworkCoreShutdown(); diff --git a/src/network/core/game.h b/src/network/core/game.h index ab94481dba..c82c5aefed 100644 --- a/src/network/core/game.h +++ b/src/network/core/game.h @@ -15,12 +15,12 @@ #ifndef NETWORK_CORE_GAME_H #define NETWORK_CORE_GAME_H -#ifdef ENABLE_NETWORK - #include "config.h" #include "../../newgrf_config.h" #include "../../date_type.h" +#ifdef ENABLE_NETWORK + /** * The game information that is not generated on-the-fly and has to * be sent to the clients. diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 32340263cf..6b5442e0e8 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -14,11 +14,11 @@ #ifndef NETWORK_CORE_PACKET_H #define NETWORK_CORE_PACKET_H -#ifdef ENABLE_NETWORK - #include "config.h" #include "core.h" +#ifdef ENABLE_NETWORK + typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint8 PacketType; ///< Identifier for the packet diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index fa3f0a12e8..c368339ef8 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -14,13 +14,13 @@ #ifndef NETWORK_CORE_TCP_H #define NETWORK_CORE_TCP_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "address.h" #include "core.h" #include "packet.h" +#ifdef ENABLE_NETWORK + /** Base socket handler for all TCP sockets */ class NetworkTCPSocketHandler : public NetworkSocketHandler { private: diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h index b1b100817f..2c54641eb0 100644 --- a/src/network/core/tcp_content.h +++ b/src/network/core/tcp_content.h @@ -14,13 +14,13 @@ #ifndef NETWORK_CORE_CONTENT_H #define NETWORK_CORE_CONTENT_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "tcp.h" #include "packet.h" #include "../../debug.h" +#ifdef ENABLE_NETWORK + /** The values in the enum are important; they are used as database 'keys' */ enum ContentType { CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 080fab7d2e..7c049dfe32 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -14,13 +14,13 @@ #ifndef NETWORK_CORE_TCP_GAME_H #define NETWORK_CORE_TCP_GAME_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "tcp.h" #include "packet.h" #include "../../core/pool_type.hpp" +#ifdef ENABLE_NETWORK + /** * Enum with all types of UDP packets. * The order of the first 4 packets MUST not be changed, as diff --git a/src/network/core/udp.h b/src/network/core/udp.h index 106c48ddef..b36c1c8b2a 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -71,8 +71,6 @@ #ifndef NETWORK_CORE_UDP_H #define NETWORK_CORE_UDP_H -#ifdef ENABLE_NETWORK - #include "os_abstraction.h" #include "address.h" #include "core.h" @@ -80,6 +78,8 @@ #include "packet.h" #include "../../debug.h" +#ifdef ENABLE_NETWORK + /** Enum with all types of UDP packets. The order MUST not be changed **/ enum PacketUDPType { PACKET_UDP_CLIENT_FIND_SERVER, ///< Queries a game server for game information diff --git a/src/network/network_content.h b/src/network/network_content.h index 610288c437..aa9a1ffbd3 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -12,11 +12,11 @@ #ifndef NETWORK_CONTENT_H #define NETWORK_CONTENT_H -#if defined(ENABLE_NETWORK) - #include "core/tcp_content.h" #include "../core/smallvec_type.hpp" +#if defined(ENABLE_NETWORK) + /** Vector with content info */ typedef SmallVector ContentVector; typedef SmallVector ConstContentVector; diff --git a/src/network/network_func.h b/src/network/network_func.h index 2a3d368828..d1b9187bc3 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -12,14 +12,14 @@ #ifndef NETWORK_FUNC_H #define NETWORK_FUNC_H -#ifdef ENABLE_NETWORK - #include "core/address.h" #include "network_type.h" #include "../console_type.h" #include "../gfx_type.h" #include "../core/smallvec_type.hpp" +#ifdef ENABLE_NETWORK + extern NetworkServerGameInfo _network_game_info; extern NetworkCompanyState *_network_company_states; diff --git a/src/network/network_gui.h b/src/network/network_gui.h index bf92e27399..eb64e1ed76 100644 --- a/src/network/network_gui.h +++ b/src/network/network_gui.h @@ -12,11 +12,11 @@ #ifndef NETWORK_GUI_H #define NETWORK_GUI_H -#ifdef ENABLE_NETWORK - #include "../window_type.h" #include "network_type.h" +#ifdef ENABLE_NETWORK + void ShowNetworkNeedPassword(NetworkPasswordType npt); void ShowNetworkGiveMoneyWindow(CompanyID company); void ShowNetworkChatQueryWindow(DestType type, int dest); diff --git a/src/network/network_internal.h b/src/network/network_internal.h index 3ce35b79ca..b894d17b93 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -12,8 +12,6 @@ #ifndef NETWORK_INTERNAL_H #define NETWORK_INTERNAL_H -#ifdef ENABLE_NETWORK - #include "network.h" #include "network_func.h" #include "network_base.h" @@ -25,6 +23,8 @@ #include "../command_type.h" +#ifdef ENABLE_NETWORK + #ifdef RANDOM_DEBUG /** * If this line is enable, every frame will have a sync test diff --git a/src/network/network_type.h b/src/network/network_type.h index 0bd4d69dec..512eebb1ea 100644 --- a/src/network/network_type.h +++ b/src/network/network_type.h @@ -12,13 +12,13 @@ #ifndef NETWORK_TYPE_H #define NETWORK_TYPE_H -#ifdef ENABLE_NETWORK - #include "../company_type.h" #include "../economy_type.h" #include "core/config.h" #include "core/game.h" +#ifdef ENABLE_NETWORK + enum { /** How many clients can we have */ MAX_CLIENTS = 255,