From: Julian Smart Date: Mon, 12 Oct 1998 07:46:15 +0000 (+0000) Subject: Changes related to stream includes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fbc535ff084f61ec376f339c515d96d74065c18b Changes related to stream includes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/docview.h b/include/wx/docview.h index dc25795242..160d51a50c 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -36,8 +36,16 @@ class WXDLLEXPORT wxCommandProcessor; class WXDLLEXPORT wxFileHistory; class WXDLLEXPORT wxConfigBase; -class WXDLLIMPORT ostream; -class WXDLLIMPORT istream; +#if wxUSE_IOSTREAMH +# include +# include +#else +# include +# include +# ifdef _MSC_VER + using namespace std; +# endif +#endif // Document manager flags #define wxDOC_SDI 1 diff --git a/include/wx/event.h b/include/wx/event.h index 1c58d1541c..8524f89390 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -186,6 +186,8 @@ const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801; const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802; const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803; +const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000; + // Compatibility #if WXWIN_COMPATIBILITY diff --git a/include/wx/log.h b/include/wx/log.h index 0c178347d9..1b78ba5b04 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -52,10 +52,18 @@ typedef unsigned long wxLogLevel; // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- -class wxTextCtrl; -class wxLogFrame; -class wxFrame; -class ostream; +class WXDLLEXPORT wxTextCtrl; +class WXDLLEXPORT wxLogFrame; +class WXDLLEXPORT wxFrame; + +#if wxUSE_IOSTREAMH +# include +#else +# include +# ifdef _MSC_VER + using namespace std; +# endif +#endif // ---------------------------------------------------------------------------- // derive from this class to redirect (or suppress, or ...) log messages @@ -166,7 +174,6 @@ private: }; // log everything to an "ostream", cerr by default -class ostream; class WXDLLEXPORT wxLogStream : public wxLog { public: @@ -357,9 +364,6 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); // parts of the program only) WXDLLEXPORT_DATA(extern bool) g_bVerbose; -// fwd decl to avoid including iostream.h here -class ostream; - // ---------------------------------------------------------------------------- // get error code/error message from system in a portable way // ---------------------------------------------------------------------------- diff --git a/include/wx/memory.h b/include/wx/memory.h index 95d016c850..8f5c81ae95 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -28,9 +28,12 @@ #include #if wxUSE_IOSTREAMH -#include +# include #else -#include +# include +# ifdef _MSC_VER + using namespace std; +# endif #endif #include "wx/string.h" diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index c4ebd06ffe..82d90dcffe 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -27,11 +27,11 @@ // ---------------------------------------------------------------------------- // fwd declarations -class wxImageList; -class wxWindow; +class WXDLLEXPORT wxImageList; +class WXDLLEXPORT wxWindow; // array of notebook pages -typedef wxWindow wxNotebookPage; // so far, any window can be a page +typedef wxWindow WXDLLEXPORT wxNotebookPage; // so far, any window can be a page WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages); // ---------------------------------------------------------------------------- diff --git a/include/wx/object.h b/include/wx/object.h index ffe51a481c..b5af8484bb 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -30,13 +30,21 @@ class WXDLLEXPORT wxObject; #endif class WXDLLEXPORT wxClassInfo; -class WXDLLIMPORT ostream; class WXDLLEXPORT wxInputStream; class WXDLLEXPORT wxObjectInputStream; class WXDLLEXPORT wxObjectOutputStream; class WXDLLEXPORT wxHashTable; class WXDLLEXPORT wxObject_Serialize; +#if wxUSE_IOSTREAMH +# include +#else +# include +# ifdef _MSC_VER + using namespace std; +# endif +#endif + /* * Dynamic object system declarations */ diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h index 07731f41fd..bd222d8715 100644 --- a/include/wx/postscrp.h +++ b/include/wx/postscrp.h @@ -34,7 +34,15 @@ public: void OnExit(); }; -class WXDLLIMPORT ofstream; +#if wxUSE_IOSTREAMH +# include +#else +# include +# ifdef _MSC_VER + using namespace std; +# endif +#endif + class WXDLLEXPORT wxPostScriptDC: public wxDC { DECLARE_DYNAMIC_CLASS(wxPostScriptDC) diff --git a/include/wx/string.h b/include/wx/string.h index 477586d7fc..94ef9cb88e 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -919,7 +919,17 @@ inline bool operator>=(const char * s1, const wxString& s2) { return s2.Cmp(s1) #ifdef STD_STRING_COMPATIBILITY // fwd decl -class WXDLLEXPORT istream; +// Known not to work with wxUSE_IOSTREAMH set to 0, so +// replacing with includes (on advice of ungod@pasdex.com.au) +// class WXDLLEXPORT istream; +#if wxUSE_IOSTREAMH +#include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif istream& WXDLLEXPORT operator>>(istream& is, wxString& str); diff --git a/include/wx/utils.h b/include/wx/utils.h index 8a05c97a83..3d9a31ddb3 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -27,6 +27,9 @@ #include #else #include +# ifdef _MSC_VER + using namespace std; +# endif #endif #ifdef __X__ diff --git a/include/wx/variant.h b/include/wx/variant.h index 5c565aba18..b2e1673301 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -25,6 +25,9 @@ #include #else #include +# ifdef _MSC_VER + using namespace std; +# endif #endif /* diff --git a/include/wx/wxexpr.h b/include/wx/wxexpr.h index 01e0d6d375..a07e6f3171 100644 --- a/include/wx/wxexpr.h +++ b/include/wx/wxexpr.h @@ -25,6 +25,9 @@ #include #else #include +# ifdef _MSC_VER + using namespace std; +# endif #endif #include "wx/list.h" diff --git a/src/common/docview.cpp b/src/common/docview.cpp index e686d80d9b..24a1e59eac 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -53,12 +53,15 @@ #if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include "fstream.h" - #if !USE_SHARED_LIBRARY IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler) IMPLEMENT_ABSTRACT_CLASS(wxView, wxEvtHandler) diff --git a/src/common/memory.cpp b/src/common/memory.cpp index d3771ff98c..1d44a664e9 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -39,10 +39,14 @@ #if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include #if !defined(__WATCOMC__) && !defined(__VMS__) #include diff --git a/src/common/object.cpp b/src/common/object.cpp index d26826ebe2..6950dc80cc 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -37,7 +37,14 @@ #if WXDEBUG || wxUSE_DEBUG_CONTEXT // for wxObject::Dump - #include +#if wxUSE_IOSTREAMH +# include +#else +# include +# ifdef _MSC_VER + using namespace std; +# endif +#endif #endif #if !USE_SHARED_LIBRARY diff --git a/src/common/postscrp.cpp b/src/common/postscrp.cpp index 2660eddec9..0a6dd57b7f 100644 --- a/src/common/postscrp.cpp +++ b/src/common/postscrp.cpp @@ -50,11 +50,15 @@ #if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include #include #include #include diff --git a/src/common/string.cpp b/src/common/string.cpp index 8b44df09b8..3cb10f3186 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -96,6 +96,18 @@ extern const char *g_szNul = &g_strEmpty.dummy; #define NAMESPACE #endif //Visual C++ +#if wxUSE_IOSTREAMH +#include +#define NAMESPACE +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#define NAMESPACE std:: +#endif + + NAMESPACE istream& operator>>(NAMESPACE istream& is, wxString& WXUNUSED(str)) { #if 0 diff --git a/src/common/time.cpp b/src/common/time.cpp index ecd30b9ac0..1d30d65da0 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -36,11 +36,15 @@ seconds since January 1, 1901, GMT. #if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include #include #if !USE_SHARED_LIBRARY diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index cb7890e7a8..b76359d8d9 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -32,11 +32,15 @@ #if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include #include #include #include diff --git a/src/common/variant.cpp b/src/common/variant.cpp index e259e9ef2f..b514bf1cd9 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -20,7 +20,14 @@ #pragma hdrstop #endif +#if wxUSE_IOSTREAMH #include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif #include "wx/string.h" #include "wx/variant.h" diff --git a/src/common/wxexpr.cpp b/src/common/wxexpr.cpp index f03b2900b7..3d4979ef4c 100644 --- a/src/common/wxexpr.cpp +++ b/src/common/wxexpr.cpp @@ -20,7 +20,15 @@ #pragma hdrstop #endif +#if wxUSE_IOSTREAMH #include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif + #include #include #include diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 674ca49a19..7e1e5a36af 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -33,7 +33,6 @@ #include #include -#include #if wxUSE_COMMON_DIALOGS #include diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 147f520545..dd2a548813 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -26,7 +26,6 @@ #include "wx/dcprint.h" #include "math.h" -#include "fstream.h" #include diff --git a/src/msw/pnghand.cpp b/src/msw/pnghand.cpp index 2fb019783b..bea92c6138 100644 --- a/src/msw/pnghand.cpp +++ b/src/msw/pnghand.cpp @@ -24,7 +24,16 @@ #include #include #include + +#if wxUSE_IOSTREAMH #include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif + #include #include #include diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 706acfcb0a..d9ae39cc62 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -34,7 +34,15 @@ #include #include -#include "fstream.h" + +#if wxUSE_IOSTREAMH +#include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif #include #include @@ -508,7 +516,8 @@ bool wxTextCtrl::LoadFile(const wxString& file) Clear(); - ifstream input(WXSTRINGCAST file, ios::nocreate | ios::in); +// ifstream input(WXSTRINGCAST file, ios::nocreate | ios::in); + ifstream input(WXSTRINGCAST file, ios::in); if (!input.bad()) { diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak index 64e3987fe7..de0ab064ae 100644 --- a/src/ntwxwin.mak +++ b/src/ntwxwin.mak @@ -29,7 +29,7 @@ CPU=i386 OBJSUFF=obj SRCSUFF=cpp -WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) +WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) #WINLINKFLAGS=/NODEFAULTLIB /INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) #WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\ @@ -169,7 +169,3 @@ LINKFLAGS=$(LINK_DEBUG_FLAGS) -machine:i386 -subsystem:windows,$(APPVER) -dll # DUMMYOBJ=$(WXDIR)\src\msw\$(DUMMY).obj - - - - diff --git a/src/png/makefile.nt b/src/png/makefile.nt index 4973db4f38..a4c8b19d4b 100644 --- a/src/png/makefile.nt +++ b/src/png/makefile.nt @@ -31,14 +31,14 @@ PRECOMP=/YuWX.H !if "$(FINAL)" == "0" OPT = /Od -CPPFLAGS= /W4 /Zi /MDd /GX $(ZOPTION) $(OPT) /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch -CFLAGS= /W4 /Zi /MDd /GX /Od /Dwx_msw $(INC) +CPPFLAGS= /W4 /Zi /MD /GX $(ZOPTION) $(OPT) /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch +CFLAGS= /W4 /Zi /MD /GX /Od /Dwx_msw $(INC) LINKFLAGS=/NOD /CO /ONERROR:NOEXE !else # /Ox for real FINAL version OPT = /O2 -CPPFLAGS= /W4 /MDd /GX /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch -CFLAGS= /W4 /MDd /GX /Dwx_msw $(INC) +CPPFLAGS= /W4 /MD /GX /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch +CFLAGS= /W4 /MD /GX /Dwx_msw $(INC) LINKFLAGS=/NOD /ONERROR:NOEXE !endif @@ -59,6 +59,8 @@ $(OBJECTS) cl -DWIN32 $(OPT) $(CFLAGS) /c $*.c clean: - erase *.obj *.exe *.lib + erase *.obj + erase *.exe + erase *.lib cleanall: clean diff --git a/src/zlib/makefile.nt b/src/zlib/makefile.nt index ab0304c547..fa57b5c76b 100644 --- a/src/zlib/makefile.nt +++ b/src/zlib/makefile.nt @@ -10,7 +10,7 @@ # See zconf.h for details about the memory requirements. # ------------- Turbo C++, Borland C++ ------------- -CFLAGS=-O2 /MDd /GX +CFLAGS=-O2 /MD /GX CC=cl LD=cl LIB=tlib @@ -82,7 +82,7 @@ $(LIBOBJECTS) << clean: - -erase *.obj - -erase *.exe - -erase *.sbr - -erase $(LIBTARGET) + -erase *.obj + -erase *.exe + -erase *.sbr + -erase $(LIBTARGET) diff --git a/utils/nplugin/samples/gui/makefile.nt b/utils/nplugin/samples/gui/makefile.nt index 2487d04e37..b488b0c624 100644 --- a/utils/nplugin/samples/gui/makefile.nt +++ b/utils/nplugin/samples/gui/makefile.nt @@ -43,7 +43,7 @@ $(PROGRAM).dll: $(DUMMYOBJ) $(OBJECTS) $(WXDIR)\lib\wx.lib $(PLUGINLIB) $(PROGRA -out:$(PROGRAM).dll \ -def:$(PROGRAM).def \ $(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res $(WXDIR)\lib\wx.lib $(PLUGINLIB) \ - $(guilibsdll) msvcrt.lib shell32.lib comctl32.lib ctl3d32.lib + $(guilibsdll) shell32.lib comctl32.lib ctl3d32.lib gui.obj: gui.$(SRCSUFF) gui.h $(DUMMYOBJ) $(cc) @<< diff --git a/utils/nplugin/samples/simple/makefile.nt b/utils/nplugin/samples/simple/makefile.nt index 896d59b83c..0697a4184e 100644 --- a/utils/nplugin/samples/simple/makefile.nt +++ b/utils/nplugin/samples/simple/makefile.nt @@ -43,7 +43,7 @@ $(PROGRAM).dll: $(DUMMYOBJ) $(OBJECTS) $(WXDIR)\lib\wx.lib $(PLUGINLIB) $(PROGRA -out:$(PROGRAM).dll \ -def:$(PROGRAM).def \ $(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res $(WXDIR)\lib\wx.lib $(PLUGINLIB) \ - $(guilibsdll) msvcrt.lib shell32.lib comctl32.lib ctl3d32.lib ole32.lib + $(guilibsdll) lib shell32.lib comctl32.lib ctl3d32.lib ole32.lib simple.obj: simple.$(SRCSUFF) $(DUMMYOBJ) $(cc) @<<