]> git.saurik.com Git - wxWidgets.git/commitdiff
and the compilation fix which really compiles, finally
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Oct 1999 19:44:11 +0000 (19:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Oct 1999 19:44:11 +0000 (19:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/socket.h
src/common/socket.cpp

index 52bc77a66a3984887d65e2c8315215dc4375f233..bc9a2c648764485d2f57ee4df69b5c8476910107 100644 (file)
 #include "wx/gsocket.h"
 
 // ------------------------------------------------------------------------
-// GSocket type alias
+// constants
 // ------------------------------------------------------------------------
 
-typedef enum {
+enum wxSocketNotify
+{
   wxSOCKET_INPUT = GSOCK_INPUT,
   wxSOCKET_OUTPUT = GSOCK_OUTPUT,
   wxSOCKET_CONNECTION = GSOCK_CONNECTION,
   wxSOCKET_LOST = GSOCK_LOST
-} wxSocketNotify;
+};
 
-enum {
+enum
+{
   wxSOCKET_INPUT_FLAG = GSOCK_INPUT_FLAG,
   wxSOCKET_OUTPUT_FLAG = GSOCK_OUTPUT_FLAG,
   wxSOCKET_CONNECTION_FLAG = GSOCK_CONNECTION_FLAG,
@@ -54,7 +56,8 @@ enum {
 
 typedef GSocketEventFlags wxSocketEventFlags;
 
-typedef enum {
+enum wxSocketError
+{
   wxSOCKET_NOERROR = GSOCK_NOERROR,
   wxSOCKET_INPOP = GSOCK_INVOP,
   wxSOCKET_IOERR = GSOCK_IOERR,
@@ -66,17 +69,26 @@ typedef enum {
   wxSOCKET_TIMEDOUT = GSOCK_TIMEDOUT,
   wxSOCKET_MEMERR = GSOCK_MEMERR,
   wxSOCKET_BUSY
-} wxSocketError;
+};
 
-enum {
+enum
+{
   wxSOCKET_NONE = 0,
   wxSOCKET_NOWAIT = 1,
   wxSOCKET_WAITALL = 2,
   wxSOCKET_BLOCK = 4
 };
 
-// this is ugly but necessary for backwards compatibility
-#define wxSockFlags wxSocketBase::wxSockFlags
+// Type of request
+enum wxSockType
+{
+    SOCK_CLIENT,
+    SOCK_SERVER,
+    SOCK_INTERNAL,
+    SOCK_UNINIT
+};
+
+typedef int wxSockFlags;
 
 // ------------------------------------------------------------------------
 // wxSocket base
@@ -89,17 +101,14 @@ class WXDLLEXPORT wxSocketBase : public wxEvtHandler
   DECLARE_CLASS(wxSocketBase)
 public:
 
-  enum {
+  enum
+  {
     NONE = wxSOCKET_NONE,
     NOWAIT = wxSOCKET_NOWAIT,
     WAITALL = wxSOCKET_WAITALL,
     SPEED = wxSOCKET_BLOCK
   };
 
-  // Type of request
-  typedef int wxSockFlags;
-
-  enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
   typedef void (*wxSockCbk)(wxSocketBase& sock, wxSocketNotify evt, char *cdata);
 
 protected:
index e9f958b92838cfea6489fd02e58cd95077bc1a11..3ce909364e9303149d38070f170ba104536bef97 100644 (file)
@@ -68,7 +68,7 @@ class wxSocketState : public wxObject
 public:
   bool notify_state;
   GSocketEventFlags evt_notify_state;
-  wxSocketBase::wxSockFlags socket_flags;
+  wxSockFlags socket_flags;
   wxSocketBase::wxSockCbk c_callback;
   char *c_callback_data;
 
@@ -80,8 +80,7 @@ public:
 // wxSocketBase ctor and dtor
 // --------------------------------------------------------------
 
-wxSocketBase::wxSocketBase(wxSocketBase::wxSockFlags _flags,
-         wxSocketBase::wxSockType _type) :
+wxSocketBase::wxSocketBase(wxSockFlags _flags, wxSockType _type) :
   wxEvtHandler(),
   m_socket(NULL), m_id(-1),
   m_flags(_flags), m_type(_type),