diff --git a/configure.in b/configure.in index 24b327aadd..61f6fe9e51 100644 --- a/configure.in +++ b/configure.in @@ -1074,6 +1074,10 @@ dnl --------------------------------------------------------------------------- WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL) WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG) +WX_ARG_ENABLE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL) +WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP) +WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP) +WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE) WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS) WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index fc214570ba..d1cbd51389 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -20,7 +20,6 @@ #define wxABORT_ON_CONFIG_ERROR - /* tests for non GUI features */ @@ -41,6 +40,136 @@ # endif #endif /* !defined(wxUSE_DYNAMIC_LOADER) */ +#ifndef wxUSE_LOG +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_LOG must be defined." +# else +# define wxUSE_LOG 0 +# endif +#endif /* !defined(wxUSE_LOG) */ + +#ifndef wxUSE_LONGLONG +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_LONGLONG must be defined." +# else +# define wxUSE_LONGLONG 0 +# endif +#endif /* !defined(wxUSE_LONGLONG) */ + +#ifndef wxUSE_MIMETYPE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_MIMETYPE must be defined." +# else +# define wxUSE_MIMETYPE 0 +# endif +#endif /* !defined(wxUSE_MIMETYPE) */ + +#ifndef wxUSE_PROTOCOL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL must be defined." +# else +# define wxUSE_PROTOCOL 0 +# endif +#endif /* !defined(wxUSE_PROTOCOL) */ + +/* we may not define wxUSE_PROTOCOL_XXX if wxUSE_PROTOCOL is set to 0 */ +#if !wxUSE_PROTOCOL +# undef wxUSE_PROTOCOL_HTTP +# undef wxUSE_PROTOCOL_FTP +# undef wxUSE_PROTOCOL_FILE +# define wxUSE_PROTOCOL_HTTP 0 +# define wxUSE_PROTOCOL_FTP 0 +# define wxUSE_PROTOCOL_FILE 0 +#endif /* wxUSE_PROTOCOL */ + +#ifndef wxUSE_PROTOCOL_HTTP +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL_HTTP must be defined." +# else +# define wxUSE_PROTOCOL_HTTP 0 +# endif +#endif /* !defined(wxUSE_PROTOCOL_HTTP) */ + +#ifndef wxUSE_PROTOCOL_FTP +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL_FTP must be defined." +# else +# define wxUSE_PROTOCOL_FTP 0 +# endif +#endif /* !defined(wxUSE_PROTOCOL_FTP) */ + +#ifndef wxUSE_PROTOCOL_FILE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL_FILE must be defined." +# else +# define wxUSE_PROTOCOL_FILE 0 +# endif +#endif /* !defined(wxUSE_PROTOCOL_FILE) */ + +#ifndef wxUSE_REGEX +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_REGEX must be defined." +# else +# define wxUSE_REGEX 0 +# endif +#endif /* !defined(wxUSE_REGEX) */ + +#ifndef wxUSE_SOCKETS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_SOCKETS must be defined." +# else +# define wxUSE_SOCKETS 0 +# endif +#endif /* !defined(wxUSE_SOCKETS) */ + +#ifndef wxUSE_STREAMS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_STREAMS must be defined." +# else +# define wxUSE_STREAMS 0 +# endif +#endif /* !defined(wxUSE_STREAMS) */ + +#ifndef wxUSE_STOPWATCH +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_STOPWATCH must be defined." +# else +# define wxUSE_STOPWATCH 0 +# endif +#endif /* !defined(wxUSE_STOPWATCH) */ + +#ifndef wxUSE_TEXTBUFFER +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TEXTBUFFER must be defined." +# else +# define wxUSE_TEXTBUFFER 0 +# endif +#endif /* !defined(wxUSE_TEXTBUFFER) */ + +#ifndef wxUSE_TEXTFILE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TEXTFILE must be defined." +# else +# define wxUSE_TEXTFILE 0 +# endif +#endif /* !defined(wxUSE_TEXTFILE) */ + +#ifndef wxUSE_UNICODE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_UNICODE must be defined." +# else +# define wxUSE_UNICODE 0 +# endif +#endif /* !defined(wxUSE_UNICODE) */ + +#ifndef wxUSE_URL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_URL must be defined." +# else +# define wxUSE_URL 0 +# endif +#endif /* !defined(wxUSE_URL) */ + /* all these tests are for GUI only */ @@ -251,14 +380,6 @@ # endif #endif /* !defined(wxUSE_LISTCTRL) */ -#ifndef wxUSE_LOG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOG must be defined." -# else -# define wxUSE_LOG 0 -# endif -#endif /* !defined(wxUSE_LOG) */ - #ifndef wxUSE_LOGGUI # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOGGUI must be defined." @@ -299,14 +420,6 @@ # endif #endif /* !defined(wxUSE_MENUS) */ -#ifndef wxUSE_MIMETYPE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MIMETYPE must be defined." -# else -# define wxUSE_MIMETYPE 0 -# endif -#endif /* !defined(wxUSE_MIMETYPE) */ - #ifndef wxUSE_MSGDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MSGDLG must be defined." @@ -371,14 +484,6 @@ # endif #endif /* !defined(wxUSE_RADIOBTN) */ -#ifndef wxUSE_REGEX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_REGEX must be defined." -# else -# define wxUSE_REGEX 0 -# endif -#endif /* !defined(wxUSE_REGEX) */ - #ifndef wxUSE_SASH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SASH must be defined." @@ -475,14 +580,6 @@ # endif #endif /* !defined(wxUSE_STATUSBAR) */ -#ifndef wxUSE_STOPWATCH -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STOPWATCH must be defined." -# else -# define wxUSE_STOPWATCH 0 -# endif -#endif /* !defined(wxUSE_STOPWATCH) */ - #ifndef wxUSE_TAB_DIALOG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TAB_DIALOG must be defined." @@ -491,14 +588,6 @@ # endif #endif /* !defined(wxUSE_TAB_DIALOG) */ -#ifndef wxUSE_TEXTBUFFER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTBUFFER must be defined." -# else -# define wxUSE_TEXTBUFFER 0 -# endif -#endif /* !defined(wxUSE_TEXTBUFFER) */ - #ifndef wxUSE_TEXTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTCTRL must be defined." @@ -507,14 +596,6 @@ # endif #endif /* !defined(wxUSE_TEXTCTRL) */ -#ifndef wxUSE_TEXTFILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE must be defined." -# else -# define wxUSE_TEXTFILE 0 -# endif -#endif /* !defined(wxUSE_TEXTFILE) */ - #ifndef wxUSE_TIPWINDOW # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TIPWINDOW must be defined." @@ -555,17 +636,107 @@ # endif #endif /* !defined(wxUSE_WXHTML_HELP) */ -#ifndef wxUSE_UNICODE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UNICODE must be defined." -# else -# define wxUSE_UNICODE 0 -# endif -#endif /* !defined(wxUSE_UNICODE) */ +#endif /* wxUSE_GUI */ /* check consistency of the settings */ + +#if wxUSE_PROTOCOL_FILE || wxUSE_PROTOCOL_FTP || wxUSE_PROTOCOL_HTTP +# if !wxUSE_PROTOCOL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL_XXX requires wxUSE_PROTOCOL" +# else +# undef wxUSE_PROTOCOL +# define wxUSE_PROTOCOL 1 +# endif +# endif +#endif /* wxUSE_PROTOCOL_XXX */ + +#if wxUSE_URL +# if !wxUSE_PROTOCOL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_URL requires wxUSE_PROTOCOL" +# else +# undef wxUSE_PROTOCOL +# define wxUSE_PROTOCOL 1 +# endif +# endif +#endif /* wxUSE_URL */ + +#if wxUSE_PROTOCOL +# if !wxUSE_SOCKETS +# if wxUSE_PROTOCOL_HTTP || wxUSE_PROTOCOL_FTP +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL_FTP/HTTP requires wxUSE_SOCKETS" +# else +# undef wxUSE_SOCKETS +# define wxUSE_SOCKETS 1 +# endif +# endif +# endif + +# if !wxUSE_STREAMS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PROTOCOL requires wxUSE_STREAMS" +# else +# undef wxUSE_STREAMS +# define wxUSE_STREAMS 1 +# endif +# endif +#endif /* wxUSE_PROTOCOL */ + +/* non GUI settings */ +#if wxUSE_STOPWATCH +# if !wxUSE_LONGLONG +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_STOPWATCH requires wxUSE_LONGLONG" +# else +# undef wxUSE_LONGLONG +# define wxUSE_LONGLONG 1 +# endif +# endif +#endif /* wxUSE_STOPWATCH */ + +#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE" +# else +# undef wxUSE_TEXTFILE +# define wxUSE_TEXTFILE 1 +# endif +#endif /* wxUSE_MIMETYPE */ + +#if wxUSE_TEXTFILE && !wxUSE_TEXTBUFFER +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TEXTFILE requires wxUSE_TEXTBUFFER" +# else +# undef wxUSE_TEXTBUFFER +# define wxUSE_TEXTBUFFER 1 +# endif +#endif /* wxUSE_TEXTFILE */ + +#if wxUSE_TEXTFILE && !wxUSE_FILE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TEXTFILE requires wxUSE_FILE" +# else +# undef wxUSE_FILE +# define wxUSE_FILE 1 +# endif +#endif /* wxUSE_TEXTFILE */ + +#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_UNICODE_MSLU requires wxUSE_UNICODE" +# else +# undef wxUSE_UNICODE +# define wxUSE_UNICODE 1 +# endif +#endif /* wxUSE_UNICODE_MSLU */ + +/* the rest of the tests is for the GUI settings only */ +#if wxUSE_GUI + #if wxUSE_BUTTON || \ wxUSE_CALENDARCTRL || \ wxUSE_CARET || \ @@ -869,17 +1040,6 @@ # endif #endif /* wxUSE_RADIOBOX */ -#if wxUSE_STOPWATCH -# if !wxUSE_LONGLONG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STOPWATCH requires wxUSE_LONGLONG" -# else -# undef wxUSE_LONGLONG -# define wxUSE_LONGLONG 1 -# endif -# endif -#endif /* wxUSE_STOPWATCH */ - #if wxUSE_LOGWINDOW # if !wxUSE_TEXTCTRL # ifdef wxABORT_ON_CONFIG_ERROR @@ -913,33 +1073,6 @@ # endif #endif /* wxUSE_DYNAMIC_CLASSES */ -#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE" -# else -# undef wxUSE_TEXTFILE -# define wxUSE_TEXTFILE 1 -# endif -#endif /* wxUSE_MIMETYPE */ - -#if wxUSE_TEXTFILE && !wxUSE_TEXTBUFFER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE requires wxUSE_TEXTBUFFER" -# else -# undef wxUSE_TEXTBUFFER -# define wxUSE_TEXTBUFFER 1 -# endif -#endif /* wxUSE_TEXTFILE */ - -#if wxUSE_TEXTFILE && !wxUSE_FILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE requires wxUSE_FILE" -# else -# undef wxUSE_FILE -# define wxUSE_FILE 1 -# endif -#endif /* wxUSE_TEXTFILE */ - #if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ # ifdef wxABORT_ON_CONFIG_ERROR # error "wxClipboard requires wxDataObject" @@ -949,14 +1082,5 @@ # endif #endif /* wxUSE_CLIPBOARD */ -#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UNICODE_MSLU requires wxUSE_UNICODE" -# else -# undef wxUSE_UNICODE -# define wxUSE_UNICODE 1 -# endif -#endif /* wxUSE_UNICODE_MSLU */ - #endif /* wxUSE_GUI */ diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 2aece57a1b..b27ec055de 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -399,8 +399,21 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 1 +// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP +// or wxURL you need to set this to 1. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_PROTOCOL 1 + +// The settings for the individual URL schemes +#define wxUSE_PROTOCOL_FILE 1 +#define wxUSE_PROTOCOL_FTP 1 +#define wxUSE_PROTOCOL_HTTP 1 + +// Define this to use wxURL class. +#define wxUSE_URL 1 // Support for regular expression matching via wxRegEx class: enable this to // use POSIX regular expressions in your code. You need to compile regex @@ -412,6 +425,9 @@ // contribute us a makefile for src/regex for it #define wxUSE_REGEX 1 +// wxSystemOptions class +#define wxUSE_SYSTEM_OPTIONS 1 + // wxWave class #define wxUSE_WAVE 1 diff --git a/include/wx/protocol/file.h b/include/wx/protocol/file.h index 773cdcc5b2..49f5182b1d 100644 --- a/include/wx/protocol/file.h +++ b/include/wx/protocol/file.h @@ -8,6 +8,7 @@ // Copyright: (c) 1997, 1998 Guilhem Lavaux // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + #ifndef __WX_PROTO_FILE_H__ #define __WX_PROTO_FILE_H__ @@ -15,6 +16,10 @@ #pragma interface "sckfile.h" #endif +#include "wx/defs.h" + +#if wxUSE_PROTOCOL_FILE + #include "wx/protocol/protocol.h" #include "wx/url.h" @@ -32,4 +37,6 @@ public: wxInputStream *GetInputStream(const wxString& path); }; -#endif +#endif // wxUSE_PROTOCOL_FILE + +#endif // __WX_PROTO_FILE_H__ diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index 0ef5e77cf8..ae7391d45e 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -17,7 +17,10 @@ #pragma interface "ftp.h" #endif -#include "wx/object.h" +#include "wx/defs.h" + +#if wxUSE_PROTOCOL_FTP + #include "wx/sckaddr.h" #include "wx/protocol/protocol.h" #include "wx/url.h" @@ -161,4 +164,6 @@ protected: // wxLog::AddTraceMask(FTP_TRACE_MASK) to see them in output #define FTP_TRACE_MASK _T("ftp") +#endif // wxUSE_PROTOCOL_FTP + #endif // __WX_FTP_H__ diff --git a/include/wx/protocol/http.h b/include/wx/protocol/http.h index 5aeea291be..7b4f5db705 100644 --- a/include/wx/protocol/http.h +++ b/include/wx/protocol/http.h @@ -11,6 +11,10 @@ #ifndef _WX_HTTP_H #define _WX_HTTP_H +#include "wx/defs.h" + +#if wxUSE_PROTOCOL_HTTP + #include "wx/list.h" #include "wx/protocol/protocol.h" @@ -48,4 +52,7 @@ protected: bool ParseHeaders(); }; -#endif +#endif // wxUSE_PROTOCOL_HTTP + +#endif // _WX_HTTP_H + diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h index 894ca9615d..a98c0527db 100644 --- a/include/wx/protocol/protocol.h +++ b/include/wx/protocol/protocol.h @@ -18,6 +18,8 @@ #include "wx/defs.h" +#if wxUSE_PROTOCOL + #include "wx/object.h" #include "wx/string.h" #include "wx/stream.h" @@ -127,4 +129,6 @@ protected: DECLARE_DYNAMIC_CLASS(wxProtoInfo) }; +#endif // wxUSE_PROTOCOL + #endif // _WX_PROTOCOL_PROTOCOL_H diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h index bc36b30ed5..d76f21470f 100644 --- a/include/wx/univ/setup.h +++ b/include/wx/univ/setup.h @@ -16,6 +16,17 @@ // not all ports implement everything... // ---------------------------------------------------------------------------- +// FIXME: why do we have different sections for Mac/OS2/the rest? Most settings +// should have the same value, like this it's a real pain to update this +// file... + +#define wxUSE_DYNAMIC_LOADER 0 + +#define wxUSE_PROTOCOL 0 +#define wxUSE_URL 0 + +#define wxUSE_UNICODE_MSLU 0 + #if defined(__WXMAC__) #define wxUSE_GUI 1 @@ -389,6 +400,7 @@ #define wxUSE_CONTROLS 1 #define wxUSE_POPUPWIN 1 +#define wxUSE_TIPWINDOW 1 #define wxUSE_BUTTON 1 #define wxUSE_BMPBUTTON 1 #define wxUSE_CALENDARCTRL 0 diff --git a/include/wx/url.h b/include/wx/url.h index 80efd19ff6..f9cfdbdb75 100644 --- a/include/wx/url.h +++ b/include/wx/url.h @@ -16,13 +16,14 @@ #pragma interface #endif -// wxWindows header -#include "wx/object.h" +#include "wx/defs.h" -// wxSocket headers +#if wxUSE_URL + +#include "wx/object.h" #include "wx/protocol/protocol.h" -#if wxUSE_SOCKETS +#if wxUSE_PROTOCOL_HTTP #include "wx/protocol/http.h" #endif @@ -35,7 +36,7 @@ typedef enum { wxURL_CONNERR, wxURL_PROTOERR } wxURLError; - + class WXDLLEXPORT wxURL : public wxObject { public: @@ -97,4 +98,7 @@ private: DECLARE_DYNAMIC_CLASS(wxURL) }; -#endif +#endif // wxUSE_URL + +#endif // _WX_URL_H + diff --git a/setup.h.in b/setup.h.in index f705138663..57922f4d85 100644 --- a/setup.h.in +++ b/setup.h.in @@ -550,6 +550,13 @@ * Use intl system */ #define wxUSE_INTL 0 +/* + * Use wxProtocol and related classes + */ +#define wxUSE_PROTOCOL 0 +#define wxUSE_PROTOCOL_FILE 0 +#define wxUSE_PROTOCOL_FTP 0 +#define wxUSE_PROTOCOL_HTTP 0 /* * Use streams */ @@ -611,6 +618,11 @@ */ #define wxUSE_UNICODE_MSLU 0 +/* + * Use wxURL class + */ +#define wxUSE_URL 0 + /* * Work around a bug in GNU libc 5.x wcstombs() implementation. * diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 6665963f88..5b11e509a0 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -32,7 +32,7 @@ #pragma hdrstop #endif -#if wxUSE_SOCKETS && wxUSE_STREAMS +#if wxUSE_PROTOCOL_FTP #ifndef WX_PRECOMP #include @@ -925,5 +925,5 @@ wxList *wxFTP::GetList(const wxString& wildcard, bool details) } #endif // WXWIN_COMPATIBILITY_2 -#endif - // wxUSE_SOCKETS +#endif // wxUSE_PROTOCOL_FTP + diff --git a/src/common/http.cpp b/src/common/http.cpp index c4d821cf85..bda7c28d00 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -20,7 +20,7 @@ #pragma hdrstop #endif -#if wxUSE_SOCKETS && wxUSE_STREAMS +#if wxUSE_PROTOCOL_HTTP #include #include @@ -343,5 +343,5 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path) return inp_stream; } -#endif - // wxUSE_SOCKETS +#endif // wxUSE_PROTOCOL_HTTP + diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp index 2203ac231f..9deef928f6 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_PROTOCOL + #include "wx/protocol/protocol.h" #include "wx/url.h" #include "wx/module.h" @@ -64,7 +66,6 @@ wxProtocol::wxProtocol() { } -#if wxUSE_SOCKETS bool wxProtocol::Reconnect() { wxIPV4address addr; @@ -166,4 +167,6 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result) { return wxPROTO_NOERR; #undef PROTO_BSIZE } -#endif + +#endif // wxUSE_PROTOCOL + diff --git a/src/common/url.cpp b/src/common/url.cpp index c2e863f0b4..f10cd6c903 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -20,8 +20,7 @@ #pragma hdrstop #endif -#include -#include +#if wxUSE_URL #include "wx/string.h" #include "wx/list.h" @@ -29,6 +28,9 @@ #include "wx/module.h" #include "wx/url.h" +#include +#include + IMPLEMENT_CLASS(wxProtoInfo, wxObject) IMPLEMENT_CLASS(wxURL, wxObject) @@ -521,3 +523,6 @@ void wxURLModule::OnExit() } #endif // wxUSE_SOCKETS + +#endif // wxUSE_URL +