From d9b0ee1eca921edab7b569859685067f280350fd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Oct 2006 14:38:58 +0000 Subject: [PATCH] fix wxFilesystem compilation if wxUSE_FFILE is 0 but wxUSE_FILE is 1; disable wxFileSystem if both wxUSE_(F)FILE are 0 (modified patch 1569960) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/chkconf.h | 8 ++++++++ src/common/filesys.cpp | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 2c94762..9642a39 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -1027,6 +1027,14 @@ # define wxUSE_STREAMS 1 # endif # endif +# if !wxUSE_FILE && !wxUSE_FFILE +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_FILESYSTEM requires either wxUSE_FILE or wxUSE_FFILE" +# else +# undef wxUSE_FILESYSTEM +# define wxUSE_FILESYSTEM 0 +# endif +# endif #endif /* wxUSE_FILESYSTEM */ #if wxUSE_FS_INET diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 2d44cf8..57fc6e3 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -214,7 +214,13 @@ wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& // we need to check whether we can really read from this file, otherwise // wxFSFile is not going to work +#if wxUSE_FILE + wxFileInputStream *is = new wxFileInputStream(fullpath); +#elif wxUSE_FFILE wxFFileInputStream *is = new wxFFileInputStream(fullpath); +#else +#error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work +#endif if ( !is->Ok() ) { delete is; -- 2.7.4