Don't compile socket table if wxUSE_SOCKET is 0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-08-18 08:09:36 +00:00
parent 4c2afb6fbc
commit 2d1084ea5d
2 changed files with 7 additions and 1 deletions

View File

@@ -37,6 +37,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#if wxUSE_SOCKETS
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxSocketTable // wxSocketTable
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -246,6 +247,7 @@ extern "C" void wxUnregisterSocketCallback(int fd, wxSocketTableType socketType)
wxTheSocketTable->UnregisterCallback(fd, socketType); wxTheSocketTable->UnregisterCallback(fd, socketType);
} }
} }
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxEventLoopImpl // wxEventLoopImpl
@@ -469,8 +471,10 @@ bool wxEventLoop::Dispatch()
FD_SET(fd, &readset); FD_SET(fd, &readset);
#if wxUSE_SOCKETS
if (wxTheSocketTable) if (wxTheSocketTable)
wxTheSocketTable->FillSets(& readset, & writeset, & highest); wxTheSocketTable->FillSets(& readset, & writeset, & highest);
#endif
if (select(highest+1, &readset, &writeset, NULL, & tv) == 0) if (select(highest+1, &readset, &writeset, NULL, & tv) == 0)
{ {
@@ -483,10 +487,12 @@ bool wxEventLoop::Dispatch()
if (FD_ISSET(fd, & readset)) if (FD_ISSET(fd, & readset))
XNextEvent((Display*) wxGetDisplay(), & event); XNextEvent((Display*) wxGetDisplay(), & event);
#if wxUSE_SOCKETS
// Check if any socket events were pending, // Check if any socket events were pending,
// and if so, call their callbacks // and if so, call their callbacks
if (wxTheSocketTable) if (wxTheSocketTable)
wxTheSocketTable->ProcessEvents(& readset, & writeset); wxTheSocketTable->ProcessEvents(& readset, & writeset);
#endif
} }
#endif #endif
} else } else

View File

@@ -14,7 +14,7 @@
#include "wx/unix/gsockunx.h" #include "wx/unix/gsockunx.h"
/* /*
* TODO: have these in a common header instead of being repeated * FIXME: have these in a common header instead of being repeated
* in evtloop.cpp and gsockx11.c * in evtloop.cpp and gsockx11.c
*/ */