From: Vadim Zeitlin Date: Sun, 26 Jan 2003 00:12:12 +0000 (+0000) Subject: added iosfwrap.h (wrapper for ) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/65f19af139b997f2140fd739256b002ccf82eef7?ds=inline added iosfwrap.h (wrapper for ) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 710af7dac1..a5510edd27 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -869,6 +869,7 @@ imagtiff.h WXH imagjpeg.h WXH imaglist.h WXH intl.h WXH Base +iosfwrap.h WXH Base ioswrap.h WXH Base ipc.h WXH Base ipcbase.h WXH Base diff --git a/include/wx/docview.h b/include/wx/docview.h index 57cf016b97..ce8b94011d 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -40,7 +40,7 @@ class WXDLLEXPORT wxFileHistory; class WXDLLEXPORT wxConfigBase; #if wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" + #include "wx/iosfwrap.h" #else #include "wx/stream.h" #endif diff --git a/include/wx/iosfwrap.h b/include/wx/iosfwrap.h new file mode 100644 index 0000000000..00e7842252 --- /dev/null +++ b/include/wx/iosfwrap.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/iosfwrap.h +// Purpose: includes the correct stream-related forward declarations +// Author: Jan van Dijk +// Modified by: +// Created: 18.12.2002 +// RCS-ID: $Id$ +// Copyright: (c) 2002 Jan van Dijk +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +#if wxUSE_STD_IOSTREAM + +#if wxUSE_IOSTREAMH + // There is no pre-ANSI iosfwd header (?). We include the full decarations. +# include +#else +# include +#endif + +#endif + // wxUSE_STD_IOSTREAM + diff --git a/include/wx/ioswrap.h b/include/wx/ioswrap.h index 2934375777..6769adc565 100644 --- a/include/wx/ioswrap.h +++ b/include/wx/ioswrap.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: ioswrap.h +// Name: wx/ioswrap.h // Purpose: includes the correct iostream headers for current compiler // Author: Vadim Zeitlin // Modified by: @@ -12,15 +12,9 @@ #if wxUSE_STD_IOSTREAM #if wxUSE_IOSTREAMH - // N.B. BC++ doesn't have istream.h, ostream.h # include #else # include -# if 0 // this is not needed any longer now that we have wxSTD -# if defined(__VISUALC__) || defined(__MWERKS__) - using namespace std; -# endif -#endif // 0 #endif #endif diff --git a/include/wx/log.h b/include/wx/log.h index 321b0c96f3..193861f4bc 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -101,7 +101,7 @@ enum #define wxTraceOleCalls 0x0100 // OLE interface calls #endif -#include "wx/ioswrap.h" +#include "wx/iosfwrap.h" // ---------------------------------------------------------------------------- // derive from this class to redirect (or suppress, or ...) log messages diff --git a/include/wx/longlong.h b/include/wx/longlong.h index 468d826636..5fc1175e7e 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -144,7 +144,7 @@ // ---------------------------------------------------------------------------- // we use iostream for wxLongLong output -#include "wx/ioswrap.h" +#include "wx/iosfwrap.h" #if wxUSE_LONGLONG_NATIVE diff --git a/include/wx/object.h b/include/wx/object.h index be4a7bbc3f..8dd677333c 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -45,11 +45,6 @@ class WXDLLEXPORT wxClassInfo; class WXDLLEXPORT wxHashTable; class WXDLLEXPORT wxObjectRefData; -#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) - #include "wx/ioswrap.h" -#endif - - // ---------------------------------------------------------------------------- // wxClassInfo // ---------------------------------------------------------------------------- @@ -326,18 +321,6 @@ inline void wxCheckCast(void *ptr) #endif // __WXDEBUG__ - -// for some reason Borland seems to need this include. -#if wxUSE_STD_IOSTREAM \ - && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) \ - && defined(__BORLANDC__) - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif -#endif // wxUSE_IOSTREAMH - // ---------------------------------------------------------------------------- // set up memory debugging macros // ---------------------------------------------------------------------------- @@ -396,6 +379,10 @@ inline void wxCheckCast(void *ptr) #endif // WXDEBUG && wxUSE_MEMORY_TRACING +#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) +// needed by wxObject::Dump +#include "wx/iosfwrap.h" +#endif // ---------------------------------------------------------------------------- // wxObject: the root class of wxWindows object hierarchy diff --git a/include/wx/string.h b/include/wx/string.h index 559817da01..c9169837c7 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1261,7 +1261,7 @@ inline wxString operator+(const wxCharBuffer& buf, const wxString& string) #if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM -#include "wx/ioswrap.h" +#include "wx/iosfwrap.h" WXDLLEXPORT wxSTD istream& operator>>(wxSTD istream&, wxString&); WXDLLEXPORT wxSTD ostream& operator<<(wxSTD ostream&, const wxString&); diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 337d8406f6..00ff41af95 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -37,7 +37,7 @@ #ifndef NO_TEXT_WINDOW_STREAM #if wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" // for iostream classes if we need them + #include "wx/ioswrap.h" // derivation: we need the full decls. #else // !wxUSE_STD_IOSTREAM // can't compile this feature in if we don't use streams at all #define NO_TEXT_WINDOW_STREAM diff --git a/include/wx/variant.h b/include/wx/variant.h index 3c47bc497e..795f92b5f4 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -32,7 +32,7 @@ #include "wx/db.h" // will #include sqltypes.h #endif //ODBC -#include "wx/ioswrap.h" +#include "wx/iosfwrap.h" /* * wxVariantData stores the actual data in a wxVariant object, diff --git a/src/common/log.cpp b/src/common/log.cpp index b53bb3a6a9..81ab68239b 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -748,6 +748,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) // ---------------------------------------------------------------------------- #if wxUSE_STD_IOSTREAM +#include "wx/ioswrap.h" wxLogStream::wxLogStream(wxSTD ostream *ostr) { if ( ostr == NULL )