X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c9eff305505d6e3a63026c542004d518d997d2a..b5435dccd098ae153c3b7b3b8fca8dd0d763986c:/src/msw/gsockmsw.c diff --git a/src/msw/gsockmsw.c b/src/msw/gsockmsw.c index d8ea3ae3c5..5016995a45 100644 --- a/src/msw/gsockmsw.c +++ b/src/msw/gsockmsw.c @@ -7,6 +7,14 @@ * ------------------------------------------------------------------------- */ +/* + * TODO: for WinCE we need to replace WSAAsyncSelect + * (Windows message-based notification of network events for a socket) + * with another mechanism. + * We may need to have a separate thread that polls for socket events + * using select() and sends a message to the main thread. + */ + /* * PLEASE don't put C++ comments here - this is a C source file. */ @@ -19,7 +27,16 @@ # pragma warning(disable:4115) /* named type definition in parentheses */ #endif +/* This needs to be before the wx/defs/h inclusion + * for some reason + */ + +#ifdef __WXWINCE__ +#include +#endif + #ifndef __GSOCKET_STANDALONE__ +#include "wx/defs.h" #include "wx/setup.h" #endif @@ -38,14 +55,21 @@ #include "gsocket.h" /* If not using wxWindows, a global var called hInst must - * be available and it must containt the app's instance + * be available and it must contain the app's instance * handle. */ #define INSTANCE hInst #endif /* __GSOCKET_STANDALONE__ */ +#ifndef __WXWINCE__ #include +#else +#define assert(x) +#include +#include "wx/msw/wince/net.h" +#endif + #include #include #include @@ -58,8 +82,8 @@ # pragma warning(default:4115) /* named type definition in parentheses */ #endif -#define CLASSNAME "_GSocket_Internal_Window_Class" -#define WINDOWNAME "_GSocket_Internal_Window_Name" +#define CLASSNAME TEXT("_GSocket_Internal_Window_Class") +#define WINDOWNAME TEXT("_GSocket_Internal_Window_Name") /* Maximum number of different GSocket objects at a given time. * This value can be modified at will, but it CANNOT be greater @@ -136,7 +160,7 @@ void GSocket_Cleanup(void) /* Per-socket GUI initialization / cleanup */ -bool _GSocket_GUI_Init(GSocket *socket) +int _GSocket_GUI_Init(GSocket *socket) { int i; @@ -187,7 +211,7 @@ LRESULT CALLBACK _GSocket_Internal_WinProc(HWND hWnd, { EnterCriticalSection(&critical); socket = socketList[(uMsg - WM_USER)]; - event = -1; + event = (GSocketEvent) -1; cback = NULL; data = NULL; @@ -278,10 +302,10 @@ void _GSocket_Disable_Events(GSocket *socket) #else /* !wxUSE_SOCKETS */ -/* +/* * Translation unit shouldn't be empty, so include this typedef to make the * compiler (VC++ 6.0, for example) happy */ -typedef (*wxDummy)(); +typedef void (*wxDummy)(); #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */