From: Jouk Jansen Date: Mon, 12 Jan 2009 09:06:36 +0000 (+0000) Subject: Fixing/Testing sockets on OpenVMS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/66034aba2e3aecd6f1af6803d44befe611191399 Fixing/Testing sockets on OpenVMS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/descrip.mms b/descrip.mms index 9293d07594..081af3d708 100644 --- a/descrip.mms +++ b/descrip.mms @@ -2,7 +2,7 @@ # * # Make file for VMS * # Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 23 November 2007 * +# Date : 12 January 2009 * # * #***************************************************************************** .first @@ -87,6 +87,8 @@ gtk : [.include.wx]setup.h $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) set default [-.richedit] # $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + set default [-.socket] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) set default [-.xrc] $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) set default [--] diff --git a/samples/sockets/baseclient.cpp b/samples/sockets/baseclient.cpp index 6199b22181..b131981988 100644 --- a/samples/sockets/baseclient.cpp +++ b/samples/sockets/baseclient.cpp @@ -72,7 +72,7 @@ WX_DECLARE_LIST(ThreadWorker, TList); WX_DECLARE_LIST(EventWorker, EList); class Client : public wxApp { - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() public: void RemoveEventWorker(EventWorker* p_worker); private: @@ -141,7 +141,7 @@ private: class EventWorker : public wxEvtHandler { - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() public: EventWorker(const wxString& p_host, char* p_buf, int p_size); void Run(); diff --git a/samples/sockets/baseserver.cpp b/samples/sockets/baseserver.cpp index 283ecb6b8e..ae30bce692 100644 --- a/samples/sockets/baseserver.cpp +++ b/samples/sockets/baseserver.cpp @@ -101,7 +101,7 @@ WX_DECLARE_LIST(EventWorker, EList); //and list of two type worker classes that serve clients class Server : public wxApp { - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() public: Server() : m_maxConnections(-1) {} ~Server() {} @@ -198,7 +198,7 @@ private: void DoWrite(); void DoRead(); - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() }; /******************* Implementation ******************/ diff --git a/samples/sockets/descrip.mms b/samples/sockets/descrip.mms new file mode 100644 index 0000000000..830103699c --- /dev/null +++ b/samples/sockets/descrip.mms @@ -0,0 +1,114 @@ +#***************************************************************************** +# * +# Make file for VMS * +# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * +# Date : 12 January 2009 * +# * +#***************************************************************************** +.first + define wx [--.include.wx] + +.ifdef __WXMOTIF__ +CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ + /assume=(nostdnew,noglobal_array_new) +.else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ + /assume=(nostdnew,noglobal_array_new) +.else +.ifdef __WXGTK2__ +CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm\ + /assume=(nostdnew,noglobal_array_new) +.else +.ifdef __WXX11__ +CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ + /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) +.else +CXX_DEFINE = +.endif +.endif +.endif +.endif + +.suffixes : .cpp + +.cpp.obj : + cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp + +all : +.ifdef __WXMOTIF__ + $(MMS)$(MMSQUALIFIERS) baseclient.exe + $(MMS)$(MMSQUALIFIERS) baseserver.exe + $(MMS)$(MMSQUALIFIERS) client.exe + $(MMS)$(MMSQUALIFIERS) server.exe +.else +.ifdef __WXGTK__ + $(MMS)$(MMSQUALIFIERS) baseclient_gtk.exe + $(MMS)$(MMSQUALIFIERS) baseserver_gtk.exe + $(MMS)$(MMSQUALIFIERS) client_gtk.exe + $(MMS)$(MMSQUALIFIERS) server_gtk.exe +.else +.ifdef __WXGTK2__ + $(MMS)$(MMSQUALIFIERS) baseclient_gtk2.exe + $(MMS)$(MMSQUALIFIERS) baseserver_gtk2.exe + $(MMS)$(MMSQUALIFIERS) client_gtk2.exe + $(MMS)$(MMSQUALIFIERS) server_gtk2.exe +.else +.ifdef __WXX11__ + $(MMS)$(MMSQUALIFIERS) baseclient_x11.exe + $(MMS)$(MMSQUALIFIERS) baseserver_x11.exe + $(MMS)$(MMSQUALIFIERS) client_x11.exe + $(MMS)$(MMSQUALIFIERS) server_x11.exe +.endif +.endif +.endif +.endif + +.ifdef __WXMOTIF__ +baseclient.exe : baseclient.obj + cxxlink baseclient,[--.lib]vms/opt +baseserver.exe : baseserver.obj + cxxlink baseserver,[--.lib]vms/opt +client.exe : client.obj + cxxlink client,[--.lib]vms/opt +server.exe : server.obj + cxxlink server,[--.lib]vms/opt +.else +.ifdef __WXGTK__ +baseclient_gtk.exe : baseclient.obj + cxxlink/exe=baseclient_gtk.exe baseclient,[--.lib]vms_gtk/opt +baseserver_gtk.exe : baseserver.obj + cxxlink/exe=baseserver_gtk.exe baseserver,[--.lib]vms_gtk/opt +client_gtk.exe : client.obj + cxxlink/exe=client_gtk client,[--.lib]vms_gtk/opt +server_gtk.exe : server.obj + cxxlink/exe=server_gtk.exe server,[--.lib]vms_gtk/opt +.else +.ifdef __WXGTK2__ +baseclient_gtk2.exe : baseclient.obj + cxxlink/exe=baseclient_gtk2.exe baseclient,[--.lib]vms_gtk2/opt +baseserver_gtk2.exe : baseserver.obj + cxxlink/exe=baseserver_gtk2.exe baseserver,[--.lib]vms_gtk2/opt +client_gtk2.exe : client.obj + cxxlink/exe=client_gtk2 client,[--.lib]vms_gtk2/opt +server_gtk2.exe : server.obj + cxxlink/exe=server_gtk2.exe server,[--.lib]vms_gtk2/opt +.else +.ifdef __WXX11__ +baseclient_x11.exe : baseclient.obj + cxxlink/exe=baseclient_x11.exe baseclient,[--.lib]vms_x11/opt +baseserver_x11.exe : baseserver.obj + cxxlink/exe=baseserver_x11.exe baseserver,[--.lib]vms_x11/opt +client_x11.exe : client.obj + cxxlink/exe=client_x11 client,[--.lib]vms_x11/opt +server_x11.exe : server.obj + cxxlink/exe=server_x11.exe server,[--.lib]vms_x11/opt +.endif +.endif +.endif +.endif + +baseclient.obj : baseclient.cpp +baseserver.obj : baseserver.cpp +client.obj : client.cpp +server.obj : server.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index c80b314d60..dc64603aa5 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -57,10 +57,12 @@ // this should cover all the current Unix systems (Windows never sends any // signals anyhow) but if we find one that has neither we should explicitly // ignore SIGPIPE for it +// OpenVMS has neither MSG_NOSIGNAL nor SO_NOSIGPIPE. However the socket sample +// seems to work. Not sure if problems will show up on OpenVMS using sockets. #ifdef MSG_NOSIGNAL #define wxSOCKET_MSG_NOSIGNAL MSG_NOSIGNAL #else // MSG_NOSIGNAL not available (BSD including OS X) - #if defined(__UNIX__) && !defined(SO_NOSIGPIPE) + #if defined(__UNIX__) && !defined(SO_NOSIGPIPE) && !defined( __VMS ) #error "Writing to socket could generate unhandled SIGPIPE." #error "Please post information about your system to wx-dev." #endif