applied patch for compilation with gcc 3.0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-06-06 16:51:53 +00:00
parent 014e19de74
commit dd107c50be
30 changed files with 146 additions and 127 deletions

View File

@@ -90,7 +90,7 @@ public:
wxDate &operator--(int) { return *this -= 1; }
#if wxUSE_STD_IOSTREAM
friend ostream WXDLLEXPORT & operator <<(ostream &os, const wxDate &dt)
friend wxSTD ostream WXDLLEXPORT & operator <<(wxSTD ostream &os, const wxDate &dt)
{ return os << dt.FormatDate().mb_str(); }
#endif

View File

@@ -55,6 +55,17 @@
#include "wx/setup.h"
// old C++ headers (like <iostream.h>) declare classes in the global namespace
// while the new, standard ones (like <iostream>) do it in std:: namespace
//
// using this macro allows constuctions like "wxSTD iostream" to work in
// either case
#if !wxUSE_IOSTREAMH
#define wxSTD std::
#else
#define wxSTD
#endif
// just in case they were defined in setup.h
#ifdef PACKAGE
#undef PACKAGE

View File

@@ -89,8 +89,8 @@ public:
virtual bool Revert();
#if wxUSE_STD_IOSTREAM
virtual ostream& SaveObject(ostream& stream);
virtual istream& LoadObject(istream& stream);
virtual wxSTD ostream& SaveObject(wxSTD ostream& stream);
virtual wxSTD istream& LoadObject(wxSTD istream& stream);
#else
virtual wxOutputStream& SaveObject(wxOutputStream& stream);
virtual wxInputStream& LoadObject(wxInputStream& stream);
@@ -634,8 +634,8 @@ protected:
#if wxUSE_STD_IOSTREAM
// For compatibility with existing file formats:
// converts from/to a stream to/from a temporary file.
bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream);
bool WXDLLEXPORT wxTransferStreamToFile(istream& stream, const wxString& filename);
bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream);
bool WXDLLEXPORT wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename);
#else
// For compatibility with existing file formats:
// converts from/to a stream to/from a temporary file.

View File

@@ -16,9 +16,11 @@
# include <iostream.h>
#else
# include <iostream>
# 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

View File

@@ -251,14 +251,14 @@ class WXDLLEXPORT wxLogStream : public wxLog
{
public:
// redirect log output to an ostream
wxLogStream(ostream *ostr = (ostream *) NULL);
wxLogStream(wxSTD ostream *ostr = (wxSTD ostream *) NULL);
protected:
// implement sink function
virtual void DoLogString(const wxChar *szString, time_t t);
// using ptr here to avoid including <iostream.h> from this file
ostream *m_ostr;
wxSTD ostream *m_ostr;
};
#endif

View File

@@ -308,7 +308,7 @@ public:
#if wxUSE_STD_IOSTREAM
// input/output
friend ostream& operator<<(ostream&, const wxLongLongNative&);
friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&);
#endif
private:
@@ -490,7 +490,7 @@ public:
// input/output
#if wxUSE_STD_IOSTREAM
friend ostream& operator<<(ostream&, const wxLongLongWx&);
friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&);
#endif // wxUSE_STD_IOSTREAM
void *asArray() const;

View File

@@ -34,7 +34,7 @@
#else
# include <iostream>
# if defined(__VISUALC__) || defined(__MWERKS__)
using namespace std;
// using namespace std;
# endif
#endif
@@ -227,8 +227,8 @@ protected:
// Traverse the list.
static void TraverseList (PmSFV, wxMemStruct *from = NULL);
static streambuf *m_streamBuf;
static ostream *m_debugStream;
static wxSTD streambuf *m_streamBuf;
static wxSTD ostream *m_debugStream;
static int debugLevel;
static bool debugOn;
@@ -244,9 +244,9 @@ public:
~wxDebugContext(void);
static bool HasStream(void) { return (m_debugStream != NULL); };
static ostream& GetStream(void) { return *m_debugStream; }
static streambuf *GetStreamBuf(void) { return m_streamBuf; }
static void SetStream(ostream *stream, streambuf *buf = NULL);
static wxSTD ostream& GetStream(void) { return *m_debugStream; }
static wxSTD streambuf *GetStreamBuf(void) { return m_streamBuf; }
static void SetStream(wxSTD ostream *stream, streambuf *buf = NULL);
static bool SetFile(const wxString& file);
static bool SetStandardError(void);

View File

@@ -254,7 +254,7 @@ class WXDLLEXPORT wxObject
#endif // Debug & memory tracing
#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
virtual void Dump(ostream& str);
virtual void Dump(wxSTD ostream& str);
#endif
#if wxUSE_SERIAL

View File

@@ -1148,8 +1148,8 @@ inline wxString operator+(const wxCharBuffer& buf, const wxString& string)
#include "wx/ioswrap.h"
WXDLLEXPORT istream& operator>>(istream&, wxString&);
WXDLLEXPORT ostream& operator<<(ostream&, const wxString&);
WXDLLEXPORT wxSTD istream& operator>>(wxSTD istream&, wxString&);
WXDLLEXPORT wxSTD ostream& operator<<(wxSTD ostream&, const wxString&);
#endif // wxSTD_STRING_COMPATIBILITY

View File

@@ -31,6 +31,13 @@
#define NO_TEXT_WINDOW_STREAM
#endif
// the streambuf which is used in the declaration of wxTextCtrlBase below is not compatible
// with the standard-conforming implementation found in newer egcs versions
// (that is, the libstdc++ v3 that is shipped with it)
#if defined(__GNUC__)&&( (__GNUC__>2) ||( (__GNUC__==2)&&(__GNUC_MINOR__>97) ) )
#define NO_TEXT_WINDOW_STREAM
#endif
#ifndef NO_TEXT_WINDOW_STREAM
#if wxUSE_STD_IOSTREAM
#include "wx/ioswrap.h" // for iostream classes if we need them

View File

@@ -55,11 +55,11 @@ public:
virtual void Copy(wxVariantData& data) = 0;
virtual bool Eq(wxVariantData& data) const = 0;
#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const = 0;
virtual bool Write(wxSTD ostream& str) const = 0;
#endif
virtual bool Write(wxString& str) const = 0;
#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str) = 0;
virtual bool Read(wxSTD istream& str) = 0;
#endif
virtual bool Read(wxString& str) = 0;
// What type is it? Return a string name.