From 5c15428b75c3d39b866b04d4a0698ff4f02b317b Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Sat, 2 Oct 1999 15:21:29 +0000 Subject: [PATCH] PROCESS_EVENTS macro added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/socket.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index dba14f4829..32689fe50d 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -44,13 +44,15 @@ #include "wx/sckaddr.h" #include "wx/socket.h" -// GRG: Why is this needed? -#ifdef __WXGTK__ +#if defined(__WXMSW__) +#define PROCESS_EVENTS() wxYield() +#elif defined(__WXGTK__) #include -#define wxYield() gtk_main_iteration() +#define PROCESS_EVENTS() gtk_main_iteration() #endif + // -------------------------------------------------------------- // ClassInfos // -------------------------------------------------------------- @@ -188,7 +190,7 @@ wxUint32 wxSocketBase::DeferRead(char *buffer, wxUint32 nbytes) // Wait for buffer completion. while (m_defer_buffer != NULL) - wxYield(); + PROCESS_EVENTS(); timer.Stop(); @@ -442,7 +444,7 @@ wxUint32 wxSocketBase::DeferWrite(const char *buffer, wxUint32 nbytes) // Wait for buffer completion. while (m_defer_buffer != NULL) - wxYield(); + PROCESS_EVENTS(); timer.Stop(); @@ -770,7 +772,7 @@ void wxSocketBase::RestoreState() // they poll the socket, using GSocket_Select(), to check for // the specified combination of event flags, until an event // occurs or until the timeout ellapses. The polling loop -// calls wxYield(), so this won't block the GUI. +// calls PROCESS_EVENTS(), so this won't block the GUI. bool wxSocketBase::_Wait(long seconds, long milliseconds, wxSocketEventFlags flags) { @@ -848,7 +850,7 @@ bool wxSocketBase::_Wait(long seconds, long milliseconds, wxSocketEventFlags fla } if (timeout != 0) - wxYield(); + PROCESS_EVENTS(); } while ((state == -1) && timeout); -- 2.45.2