* Made GSocket::GetError() exp/imp from net library and provide an inline
compatibility function. * Provide a Null gs_gui_functions implementation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c90cc42e98
commit
a45068485c
@ -332,8 +332,6 @@ void GSocket_SetNonBlocking(GSocket *socket, int non_block);
|
||||
*/
|
||||
void GSocket_SetTimeout(GSocket *socket, unsigned long millisec);
|
||||
|
||||
#endif /* ndef wxUSE_GSOCKET_CPLUSPLUS */
|
||||
|
||||
/* GSocket_GetError:
|
||||
* Returns the last error occured for this socket. Note that successful
|
||||
* operations do not clear this back to GSOCK_NOERROR, so use it only
|
||||
@ -341,8 +339,6 @@ void GSocket_SetTimeout(GSocket *socket, unsigned long millisec);
|
||||
*/
|
||||
GSocketError WXDLLIMPEXP_NET GSocket_GetError(GSocket *socket);
|
||||
|
||||
#ifndef wxUSE_GSOCKET_CPLUSPLUS
|
||||
|
||||
/* Callbacks */
|
||||
|
||||
/* GSOCK_INPUT:
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
GSocketEventFlags Select(GSocketEventFlags flags);
|
||||
void SetNonBlocking(bool non_block);
|
||||
void SetTimeout(unsigned long millis);
|
||||
GSocketError GetError();
|
||||
GSocketError WXDLLIMPEXP_NET GetError();
|
||||
void SetCallback(GSocketEventFlags flags,
|
||||
GSocketCallback callback, char *cdata);
|
||||
void UnsetCallback(GSocketEventFlags flags);
|
||||
@ -155,6 +155,8 @@ inline void GSocket_SetNonBlocking(GSocket *socket, int non_block)
|
||||
{ socket->SetNonBlocking(non_block); }
|
||||
inline void GSocket_SetTimeout(GSocket *socket, unsigned long millisec)
|
||||
{ socket->SetTimeout(millisec); }
|
||||
inline GSocketError GSocket_GetError(GSocket *socket)
|
||||
{ return socket->GetError(); }
|
||||
inline void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags,
|
||||
GSocketCallback fallback, char *cdata)
|
||||
{ socket->SetCallback(flags,fallback,cdata); }
|
||||
|
@ -83,6 +83,32 @@
|
||||
|
||||
static class GSocketGUIFunctionsTable *gs_gui_functions;
|
||||
|
||||
class GSocketGUIFunctionsTableNull: public GSocketGUIFunctionsTable
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
virtual void OnExit();
|
||||
virtual bool CanUseEventLoop();
|
||||
virtual bool Init_Socket(GSocket *socket);
|
||||
virtual void Destroy_Socket(GSocket *socket);
|
||||
virtual void Enable_Events(GSocket *socket);
|
||||
virtual void Disable_Events(GSocket *socket);
|
||||
};
|
||||
|
||||
bool GSocketGUIFunctionsTableNull::OnInit()
|
||||
{ return true; }
|
||||
void GSocketGUIFunctionsTableNull::OnExit()
|
||||
{}
|
||||
bool GSocketGUIFunctionsTableNull::CanUseEventLoop()
|
||||
{ return false; }
|
||||
bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *socket)
|
||||
{ return true; }
|
||||
void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *socket)
|
||||
{}
|
||||
void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *socket)
|
||||
{}
|
||||
void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *socket)
|
||||
{}
|
||||
/* Global initialisers */
|
||||
|
||||
void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *guifunc)
|
||||
@ -94,12 +120,14 @@ int GSocket_Init(void)
|
||||
{
|
||||
WSADATA wsaData;
|
||||
|
||||
if (gs_gui_functions)
|
||||
if (!gs_gui_functions)
|
||||
{
|
||||
if ( !gs_gui_functions->OnInit() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static class GSocketGUIFunctionsTableNull table;
|
||||
gs_gui_functions = &table;
|
||||
}
|
||||
if ( !gs_gui_functions->OnInit() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize WinSocket */
|
||||
@ -902,7 +930,7 @@ void GSocket::SetTimeout(unsigned long millis)
|
||||
* operations do not clear this back to GSOCK_NOERROR, so use it only
|
||||
* after an error.
|
||||
*/
|
||||
GSocketError GSocket::GetError()
|
||||
GSocketError WXDLLIMPEXP_NET GSocket::GetError()
|
||||
{
|
||||
assert(this);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user