From f92f546c44e5d59a69c0d5a716ee3100d34e3192 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 23 Feb 2001 22:52:11 +0000 Subject: [PATCH] using wxURL now enforces linking http.o, ftp.o and sckfile.o git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 3 ++- include/wx/protocol/protocol.h | 10 +++++++++- src/common/url.cpp | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 928d3c1f6f..9ad280061b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -9,11 +9,12 @@ wxWindows 2 Change Log wxBase: +- fixed problem with wxURL when using static version of the library +- wxZipFSHandler::FindFirst() and FindNext() now correctly list directories - wxMimeTypesManager now can create file associations too - wxCopyFile() respects the file permissions (Roland Scholz) - wxFTP::GetFileSize() added (Søren Erland Vestø) - wxDateTime::IsSameDate() bug fixed -- wxZipFSHandler::FindFirst() and FindNext() now correctly list directories All (GUI): diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h index 1ac98294c8..894ca9615d 100644 --- a/include/wx/protocol/protocol.h +++ b/include/wx/protocol/protocol.h @@ -96,7 +96,15 @@ public: \ static wxProtoInfo g_proto_##class; #define IMPLEMENT_PROTOCOL(class, name, serv, host) \ -wxProtoInfo class::g_proto_##class(name, serv, host, CLASSINFO(class)); +wxProtoInfo class::g_proto_##class(name, serv, host, CLASSINFO(class)); \ +bool wxProtocolUse##class = TRUE; + +#define USE_PROTOCOL(class) \ + extern bool wxProtocolUse##class ; \ + static struct wxProtocolUserFor##class \ + { \ + wxProtocolUserFor##class() { wxProtocolUse##class = TRUE; } \ + } wxProtocolDoUse##class; class WXDLLEXPORT wxProtoInfo : public wxObject { diff --git a/src/common/url.cpp b/src/common/url.cpp index b6c54cca45..eae17c35ca 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -35,6 +35,11 @@ IMPLEMENT_CLASS(wxURL, wxObject) // Protocols list wxProtoInfo *wxURL::ms_protocols = NULL; +// Enforce linking of protocol classes: +USE_PROTOCOL(wxHTTP) +USE_PROTOCOL(wxFTP) +USE_PROTOCOL(wxFileProto) + #if wxUSE_SOCKETS wxHTTP *wxURL::ms_proxyDefault = NULL; bool wxURL::ms_useDefaultProxy = FALSE; -- 2.45.2