1
0
Fork 0

(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

release/1.0
rubidium 2009-10-04 20:00:56 +00:00
parent 1ee5520854
commit 5ff6053326
13 changed files with 26 additions and 26 deletions

View File

@ -12,13 +12,13 @@
#ifndef NETWORK_ADDRESS_H #ifndef NETWORK_ADDRESS_H
#define NETWORK_ADDRESS_H #define NETWORK_ADDRESS_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "config.h" #include "config.h"
#include "../../string_func.h" #include "../../string_func.h"
#include "../../core/smallmap_type.hpp" #include "../../core/smallmap_type.hpp"
#ifdef ENABLE_NETWORK
class NetworkAddress; class NetworkAddress;
typedef SmallVector<NetworkAddress, 4> NetworkAddressList; typedef SmallVector<NetworkAddress, 4> NetworkAddressList;
typedef SmallMap<NetworkAddress, SOCKET, 4> SocketList; typedef SmallMap<NetworkAddress, SOCKET, 4> SocketList;

View File

@ -14,11 +14,11 @@
#ifndef NETWORK_CORE_H #ifndef NETWORK_CORE_H
#define NETWORK_CORE_H #define NETWORK_CORE_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "../../newgrf_config.h" #include "../../newgrf_config.h"
#ifdef ENABLE_NETWORK
bool NetworkCoreInitialize(); bool NetworkCoreInitialize();
void NetworkCoreShutdown(); void NetworkCoreShutdown();

View File

@ -15,12 +15,12 @@
#ifndef NETWORK_CORE_GAME_H #ifndef NETWORK_CORE_GAME_H
#define NETWORK_CORE_GAME_H #define NETWORK_CORE_GAME_H
#ifdef ENABLE_NETWORK
#include "config.h" #include "config.h"
#include "../../newgrf_config.h" #include "../../newgrf_config.h"
#include "../../date_type.h" #include "../../date_type.h"
#ifdef ENABLE_NETWORK
/** /**
* The game information that is not generated on-the-fly and has to * The game information that is not generated on-the-fly and has to
* be sent to the clients. * be sent to the clients.

View File

@ -14,11 +14,11 @@
#ifndef NETWORK_CORE_PACKET_H #ifndef NETWORK_CORE_PACKET_H
#define NETWORK_CORE_PACKET_H #define NETWORK_CORE_PACKET_H
#ifdef ENABLE_NETWORK
#include "config.h" #include "config.h"
#include "core.h" #include "core.h"
#ifdef ENABLE_NETWORK
typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint16 PacketSize; ///< Size of the whole packet.
typedef uint8 PacketType; ///< Identifier for the packet typedef uint8 PacketType; ///< Identifier for the packet

View File

@ -14,13 +14,13 @@
#ifndef NETWORK_CORE_TCP_H #ifndef NETWORK_CORE_TCP_H
#define NETWORK_CORE_TCP_H #define NETWORK_CORE_TCP_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "address.h" #include "address.h"
#include "core.h" #include "core.h"
#include "packet.h" #include "packet.h"
#ifdef ENABLE_NETWORK
/** Base socket handler for all TCP sockets */ /** Base socket handler for all TCP sockets */
class NetworkTCPSocketHandler : public NetworkSocketHandler { class NetworkTCPSocketHandler : public NetworkSocketHandler {
private: private:

View File

@ -14,13 +14,13 @@
#ifndef NETWORK_CORE_CONTENT_H #ifndef NETWORK_CORE_CONTENT_H
#define NETWORK_CORE_CONTENT_H #define NETWORK_CORE_CONTENT_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "tcp.h" #include "tcp.h"
#include "packet.h" #include "packet.h"
#include "../../debug.h" #include "../../debug.h"
#ifdef ENABLE_NETWORK
/** The values in the enum are important; they are used as database 'keys' */ /** The values in the enum are important; they are used as database 'keys' */
enum ContentType { enum ContentType {
CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types

View File

@ -14,13 +14,13 @@
#ifndef NETWORK_CORE_TCP_GAME_H #ifndef NETWORK_CORE_TCP_GAME_H
#define NETWORK_CORE_TCP_GAME_H #define NETWORK_CORE_TCP_GAME_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "tcp.h" #include "tcp.h"
#include "packet.h" #include "packet.h"
#include "../../core/pool_type.hpp" #include "../../core/pool_type.hpp"
#ifdef ENABLE_NETWORK
/** /**
* Enum with all types of UDP packets. * Enum with all types of UDP packets.
* The order of the first 4 packets MUST not be changed, as * The order of the first 4 packets MUST not be changed, as

View File

@ -71,8 +71,6 @@
#ifndef NETWORK_CORE_UDP_H #ifndef NETWORK_CORE_UDP_H
#define NETWORK_CORE_UDP_H #define NETWORK_CORE_UDP_H
#ifdef ENABLE_NETWORK
#include "os_abstraction.h" #include "os_abstraction.h"
#include "address.h" #include "address.h"
#include "core.h" #include "core.h"
@ -80,6 +78,8 @@
#include "packet.h" #include "packet.h"
#include "../../debug.h" #include "../../debug.h"
#ifdef ENABLE_NETWORK
/** Enum with all types of UDP packets. The order MUST not be changed **/ /** Enum with all types of UDP packets. The order MUST not be changed **/
enum PacketUDPType { enum PacketUDPType {
PACKET_UDP_CLIENT_FIND_SERVER, ///< Queries a game server for game information PACKET_UDP_CLIENT_FIND_SERVER, ///< Queries a game server for game information

View File

@ -12,11 +12,11 @@
#ifndef NETWORK_CONTENT_H #ifndef NETWORK_CONTENT_H
#define NETWORK_CONTENT_H #define NETWORK_CONTENT_H
#if defined(ENABLE_NETWORK)
#include "core/tcp_content.h" #include "core/tcp_content.h"
#include "../core/smallvec_type.hpp" #include "../core/smallvec_type.hpp"
#if defined(ENABLE_NETWORK)
/** Vector with content info */ /** Vector with content info */
typedef SmallVector<ContentInfo *, 16> ContentVector; typedef SmallVector<ContentInfo *, 16> ContentVector;
typedef SmallVector<const ContentInfo *, 16> ConstContentVector; typedef SmallVector<const ContentInfo *, 16> ConstContentVector;

View File

@ -12,14 +12,14 @@
#ifndef NETWORK_FUNC_H #ifndef NETWORK_FUNC_H
#define NETWORK_FUNC_H #define NETWORK_FUNC_H
#ifdef ENABLE_NETWORK
#include "core/address.h" #include "core/address.h"
#include "network_type.h" #include "network_type.h"
#include "../console_type.h" #include "../console_type.h"
#include "../gfx_type.h" #include "../gfx_type.h"
#include "../core/smallvec_type.hpp" #include "../core/smallvec_type.hpp"
#ifdef ENABLE_NETWORK
extern NetworkServerGameInfo _network_game_info; extern NetworkServerGameInfo _network_game_info;
extern NetworkCompanyState *_network_company_states; extern NetworkCompanyState *_network_company_states;

View File

@ -12,11 +12,11 @@
#ifndef NETWORK_GUI_H #ifndef NETWORK_GUI_H
#define NETWORK_GUI_H #define NETWORK_GUI_H
#ifdef ENABLE_NETWORK
#include "../window_type.h" #include "../window_type.h"
#include "network_type.h" #include "network_type.h"
#ifdef ENABLE_NETWORK
void ShowNetworkNeedPassword(NetworkPasswordType npt); void ShowNetworkNeedPassword(NetworkPasswordType npt);
void ShowNetworkGiveMoneyWindow(CompanyID company); void ShowNetworkGiveMoneyWindow(CompanyID company);
void ShowNetworkChatQueryWindow(DestType type, int dest); void ShowNetworkChatQueryWindow(DestType type, int dest);

View File

@ -12,8 +12,6 @@
#ifndef NETWORK_INTERNAL_H #ifndef NETWORK_INTERNAL_H
#define NETWORK_INTERNAL_H #define NETWORK_INTERNAL_H
#ifdef ENABLE_NETWORK
#include "network.h" #include "network.h"
#include "network_func.h" #include "network_func.h"
#include "network_base.h" #include "network_base.h"
@ -25,6 +23,8 @@
#include "../command_type.h" #include "../command_type.h"
#ifdef ENABLE_NETWORK
#ifdef RANDOM_DEBUG #ifdef RANDOM_DEBUG
/** /**
* If this line is enable, every frame will have a sync test * If this line is enable, every frame will have a sync test

View File

@ -12,13 +12,13 @@
#ifndef NETWORK_TYPE_H #ifndef NETWORK_TYPE_H
#define NETWORK_TYPE_H #define NETWORK_TYPE_H
#ifdef ENABLE_NETWORK
#include "../company_type.h" #include "../company_type.h"
#include "../economy_type.h" #include "../economy_type.h"
#include "core/config.h" #include "core/config.h"
#include "core/game.h" #include "core/game.h"
#ifdef ENABLE_NETWORK
enum { enum {
/** How many clients can we have */ /** How many clients can we have */
MAX_CLIENTS = 255, MAX_CLIENTS = 255,