Made wxSocket compile using makefiles; #ifdefed out <<, >> operators in stream.cpp

for USE_SERIALL; included io.h for VC++ in socket.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 1998-09-07 07:58:29 +00:00
parent d3904ceb9a
commit fcc6dddd1f
17 changed files with 206 additions and 51 deletions

View File

@ -291,6 +291,15 @@ samples/dynamic/*.bmp
samples/dynamic/*.rc
samples/dynamic/*.wav
samples/wxsocket/*.cpp
samples/wxsocket/*.h
samples/wxsocket/*.def
samples/wxsocket/makefile*
samples/wxsocket/*.xbm
samples/wxsocket/*.xpm
samples/wxsocket/*.ico
samples/wxsocket/*.rc
samples/bombs/*.cpp
samples/bombs/*.h
samples/bombs/*.def

View File

@ -99,7 +99,9 @@ class WXDLLEXPORT wxInputStream {
wxInputStream& operator>>(int& i);
wxInputStream& operator>>(long& i);
wxInputStream& operator>>(float& i);
#if USE_SERIAL
wxInputStream& operator>>(wxObject *& obj);
#endif
wxInputStream& operator>>(unsigned char& c) { return operator>>((char&)c); }
wxInputStream& operator>>(unsigned short& i) { return operator>>((short&)i); }
@ -150,7 +152,9 @@ class WXDLLEXPORT wxOutputStream {
wxOutputStream& operator<<(int i);
wxOutputStream& operator<<(long i);
wxOutputStream& operator<<(double f);
#if USE_SERIAL
wxOutputStream& operator<<(wxObject& obj);
#endif
wxOutputStream& operator<<(float f) { return operator<<((double)f); }
wxOutputStream& operator<<(unsigned char c) { return operator<<((char)c); }

View File

@ -1,3 +1,3 @@
mondrian ICON mondrian.ico
conn_icn ICON connect.ico
#include "wx.rc"
#include "wx/msw/wx.rc"

View File

@ -7,21 +7,24 @@
# "%W% %G%"
#
# Makefile : Builds wxSock library for Windows NT / Win95
!include <..\..\..\src\ntwxwin.mak>
EXTRALIBS=wsock32.lib
!include <..\..\src\ntwxwin.mak>
# Change WXDIR or WXWIN to wherever wxWindows is found
#WXWIN = $(WX)
WXDIR = $(WXWIN)
WXINC = $(WXDIR)\include\msw
#WXDIR = $(WXWIN)
#WXINC = $(WXDIR)\include\msw
WXSOCKDIR = $(WXDIR)\contrib\wxsock
WXSOCKINC = $(WXSOCKDIR)
WXSOCKLIB = $(WXSOCKDIR)\lib\wxsock.lib $(WXSOCKDIR)\lib\zlib.lib
INC=-I$(WXBASEINC) -I$(WXINC) -I$(WXSOCKINC)
#WXSOCKDIR = $(WXDIR)\contrib\wxsock
#WXSOCKINC = $(WXSOCKDIR)
#WXSOCKLIB = $(WXSOCKDIR)\lib\wxsock.lib $(WXSOCKDIR)\lib\zlib.lib
WXLIB = $(WXDIR)\lib\wx.lib
LIBS=$(WXSOCKLIB) wsock32.lib $(LIBS)
#INC=-I$(WXBASEINC) -I$(WXINC) # -I$(WXSOCKINC)
#WXLIB = $(WXDIR)\lib\wx.lib
#LIBS=$(WXSOCKLIB) wsock32.lib $(LIBS)
#LIBS=$(WXSOCKLIB) wsock32.lib $(LIBS)
#LIBS=$(WXLIB) $(WXSTRINGLIB) oldnames libw llibcew llibce commdlg shell
all: client.exe server.exe
@ -31,19 +34,19 @@ wx:
nmake -f makefile.nt
cd $(ITSYDIR)
client.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) $(WXSTRINGLIB) client.obj\
client.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) client.obj\
client.res
$(link) -out:client.exe $(LINKFLAGS) $(DUMMYOBJ) client.obj \
client.res $(LIBS)
server.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) $(WXSTRINGLIB) server.obj
server.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) server.obj
$(link) -out:server.exe $(LINKFLAGS) $(DUMMYOBJ) server.obj $(LIBS)
client.obj: client.$(SRCSUFF)
$(cc) $(CPPFLAGS2) /c /Tp $*.$(SRCSUFF)
client.res: client.rc $(WXDIR)\include\msw\wx.rc
$(rc) -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa -fo$@ client.rc
client.res: client.rc $(WXDIR)\include\wx\msw\wx.rc
$(rc) -r /i$(WXDIR)\include -fo$@ client.rc
server.obj: server.$(SRCSUFF)

View File

@ -1,4 +1,4 @@
mondrian ICON "mondrian.ico"
conn_icn ICON "connect.ico"
#include "wx.rc"
#include "wx/msw/wx.rc"

View File

@ -13,6 +13,16 @@
#pragma implementation "http.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include <stdio.h>
#include <stdlib.h>
#include "wx/string.h"
@ -22,10 +32,6 @@
#include "wx/protocol/http.h"
#include "wx/sckstrm.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol)
IMPLEMENT_PROTOCOL(wxHTTP, "http", "80", TRUE)

View File

@ -12,6 +12,20 @@
#pragma implementation "objstrm.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/defs.h"
#include "wx/setup.h"
#endif
#if USE_SERIAL
#include "wx/object.h"
#include "wx/objstrm.h"
#include "wx/datstrm.h"
@ -310,3 +324,6 @@ wxObject *wxObjectInputStream::LoadObject()
return object;
}
#endif

View File

@ -13,19 +13,20 @@
#pragma implementation "protocol.h"
#endif
#ifdef WXPREC
#include <wx/wxprec.h>
#else
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "wx/protocol/protocol.h"
#include "wx/url.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/////////////////////////////////////////////////////////////////
// wxProtoInfo
/////////////////////////////////////////////////////////////////

View File

@ -13,6 +13,16 @@
#pragma implementation "sckaddr.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@ -42,10 +52,6 @@
#include "wx/sckaddr.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#define CHECK_ADDRTYPE(var, type)
#if !USE_SHARED_LIBRARY

View File

@ -11,15 +11,22 @@
#ifdef __GNUG__
#pragma implementation "sckfile.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <wx/fstream.h>
#include "wx/protocol/file.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include <stdio.h>
#include <stdlib.h>
#include <wx/fstream.h>
#include "wx/protocol/file.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
IMPLEMENT_PROTOCOL(wxFileProto, "file", NULL, FALSE)

View File

@ -13,15 +13,19 @@
#pragma implementation "sckipc.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include <stdlib.h>
#include <stdio.h>
#ifdef WXPREC
#include <wx/wxprec.h>
#else
#include <wx/wx.h>
#endif
#include "wx/socket.h"
#include "wx/sckipc.h"

View File

@ -12,6 +12,16 @@
#pragma implementation "sckstrm.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include "wx/stream.h"
#include "wx/socket.h"
#include "wx/sckstrm.h"

View File

@ -15,6 +15,13 @@
#pragma implementation "socket.cpp"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/////////////////////////////////////////////////////////////////////////////
// wxWindows headers
/////////////////////////////////////////////////////////////////////////////
@ -52,6 +59,10 @@
#include <signal.h>
#include <errno.h>
#ifdef _MSC_VER
#include <io.h>
#endif
#if defined(__WXMOTIF__) || defined(__WXXT__)
#include <X11/Intrinsic.h>
@ -75,10 +86,6 @@
#include "wx/sckaddr.h"
#include "wx/socket.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/////////////////////////////////////////////////////////////////////////////
// Some patch ///// BEGIN
/////////////////////////////////////////////////////////////////////////////

View File

@ -363,12 +363,14 @@ wxInputStream& wxInputStream::operator>>(float& f)
return *this;
}
#if USE_SERIAL
wxInputStream& wxInputStream::operator>>(wxObject *& obj)
{
wxObjectInputStream obj_s(*this);
obj = obj_s.LoadObject();
return *this;
}
#endif
off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode)
{
@ -542,12 +544,14 @@ wxOutputStream& wxOutputStream::operator<<(double f)
return Write(strfloat, strfloat.Len());
}
#if USE_SERIAL
wxOutputStream& wxOutputStream::operator<<(wxObject& obj)
{
wxObjectOutputStream obj_s(*this);
obj_s.SaveObject(obj);
return *this;
}
#endif
// ----------------------------------------------------------------------------
// wxStream

View File

@ -13,6 +13,16 @@
#pragma implementation "tokenzr.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include "wx/object.h"
#include "wx/string.h"
#include "wx/tokenzr.h"

View File

@ -12,6 +12,17 @@
#ifdef __GNUG__
#pragma implementation "url.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#include <string.h>
#include <ctype.h>
@ -23,10 +34,6 @@
// wxSocket header
#include "wx/url.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxProtoInfo, wxObject)
IMPLEMENT_CLASS(wxURL, wxObject)
@ -133,7 +140,7 @@ bool wxURL::PrepHost(wxString& url)
{
int pos, pos2;
if ((url[0UL] != '/') || (url[1UL] != '/'))
if ((url.GetChar(0) != '/') || (url.GetChar(1) != '/'))
return FALSE;
url = url(2, url.Length());

View File

@ -108,7 +108,16 @@ COMMONOBJS = \
$(COMMDIR)\hash.obj \
$(COMMDIR)\list.obj \
$(COMMDIR)\string.obj \
$(COMMDIR)\socket.obj \
$(COMMDIR)\sckaddr.obj \
$(COMMDIR)\sckfile.obj \
$(COMMDIR)\sckipc.obj \
$(COMMDIR)\sckstrm.obj \
$(COMMDIR)\url.obj \
$(COMMDIR)\http.obj \
$(COMMDIR)\protocol.obj \
$(COMMDIR)\time.obj \
$(COMMDIR)\tokenzr.obj \
$(COMMDIR)\wxexpr.obj \
$(COMMDIR)\y_tab.obj \
$(COMMDIR)\extended.obj \
@ -118,6 +127,7 @@ COMMONOBJS = \
$(COMMDIR)\zstream.obj \
$(COMMDIR)\stream.obj \
$(COMMDIR)\datstrm.obj \
$(COMMDIR)\objstrm.obj \
$(COMMDIR)\wincmn.obj
MSWOBJS = \
@ -914,6 +924,51 @@ $(COMMDIR)/string.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/socket.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/sckaddr.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/sckfile.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/sckipc.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/sckstrm.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/url.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/http.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/protocol.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/tokenzr.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/matrix.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
@ -959,9 +1014,14 @@ $(COMMDIR)\datstrm.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)\objstrm.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/extended.obj: $*.c
cl @<<
$(CPPFLAGS2) /c /Tp $*.c /Fo$@
$(CPPFLAGS2) /c $*.c /Fo$@
<<
$(COMMDIR)/process.obj: $*.$(SRCSUFF)