]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/socket.cpp
unicode compilation fix
[wxWidgets.git] / src / common / socket.cpp
index 96f06d81b2d157aa2e500a2aa4d09e8418fb619c..6e41b0e4c31b391baae2c93427cccaba073acf1b 100644 (file)
@@ -13,7 +13,7 @@
 // Declarations
 // ==========================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "socket.h"
 #endif
 
 #include "wx/sckaddr.h"
 #include "wx/socket.h"
 
+// DLL options compatibility check:
+#include "wx/build.h"
+WX_CHECK_BUILD_OPTIONS("wxNet")
+
 // --------------------------------------------------------------------------
 // macros and constants
 // --------------------------------------------------------------------------
@@ -122,6 +126,12 @@ bool wxSocketBase::Initialize()
 {
     if ( !m_countInit++ )
     {
+        wxAppTraits *traits = wxAppConsole::GetInstance() ?
+                              wxAppConsole::GetInstance()->GetTraits() : NULL;
+        GSocketGUIFunctionsTable *functions = 
+            traits ? traits->GetSocketGUIFunctionsTable() : NULL;
+        GSocket_SetGUIFunctions(functions);
+        
         if ( !GSocket_Init() )
         {
             m_countInit--;
@@ -556,7 +566,6 @@ wxSocketBase& wxSocketBase::WriteMsg(const void *buffer, wxUint32 nbytes)
 {
   wxUint32 total;
   bool error;
-  int old_flags;
   struct
   {
     unsigned char sig[4];
@@ -568,7 +577,6 @@ wxSocketBase& wxSocketBase::WriteMsg(const void *buffer, wxUint32 nbytes)
 
   error = TRUE;
   total = 0;
-  old_flags = m_flags;
   SetFlags((m_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL);
 
   msg.sig[0] = (unsigned char) 0xad;
@@ -622,7 +630,6 @@ wxSocketBase& wxSocketBase::Unread(const void *buffer, wxUint32 nbytes)
 
 wxSocketBase& wxSocketBase::Discard()
 {
-  int old_flags;
   char *buffer = new char[MAX_DISCARD_SIZE];
   wxUint32 ret;
   wxUint32 total = 0;
@@ -630,7 +637,6 @@ wxSocketBase& wxSocketBase::Discard()
   // Mask read events
   m_reading = TRUE;
 
-  old_flags = m_flags;
   SetFlags(wxSOCKET_NOWAIT);
 
   do
@@ -828,7 +834,7 @@ void wxSocketBase::SaveState()
 
 void wxSocketBase::RestoreState()
 {
-  wxNode *node;
+  wxList::compatibility_iterator node;
   wxSocketState *state;
 
   node = m_states.GetLast();
@@ -846,7 +852,7 @@ void wxSocketBase::RestoreState()
   m_cdata      = state->m_cdata;
 #endif // WXWIN_COMPATIBILITY
 
-  delete node;
+  m_states.Erase(node);
   delete state;
 }