mirror of https://github.com/fltk/fltk
removed unused wsock api, fixed return result in fl_ready()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6167 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
cc6c750d60
commit
c874be7712
|
@ -73,7 +73,7 @@
|
||||||
typedef int (WINAPI* fl_wsk_select_f)(int, fd_set*, fd_set*, fd_set*, const struct timeval*);
|
typedef int (WINAPI* fl_wsk_select_f)(int, fd_set*, fd_set*, fd_set*, const struct timeval*);
|
||||||
typedef int (WINAPI* fl_wsk_fd_is_set_f)(SOCKET, fd_set *);
|
typedef int (WINAPI* fl_wsk_fd_is_set_f)(SOCKET, fd_set *);
|
||||||
typedef int (WINAPI* fl_wsk_async_select_f)(SOCKET,HWND,u_int,long);
|
typedef int (WINAPI* fl_wsk_async_select_f)(SOCKET,HWND,u_int,long);
|
||||||
typedef int (WINAPI* fl_wsk_startup_f)(WORD,LPWSADATA);
|
//typedef int (WINAPI* fl_wsk_startup_f)(WORD,LPWSADATA);
|
||||||
static HMODULE s_wsock_mod = 0;
|
static HMODULE s_wsock_mod = 0;
|
||||||
static fl_wsk_select_f s_wsock_select=0;
|
static fl_wsk_select_f s_wsock_select=0;
|
||||||
static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0;
|
static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0;
|
||||||
|
@ -267,9 +267,7 @@ int fl_wait(double time_to_wait) {
|
||||||
t.tv_usec = 0;
|
t.tv_usec = 0;
|
||||||
|
|
||||||
fd_set fdt[3];
|
fd_set fdt[3];
|
||||||
memcpy(&fdt[0],&fdsets[0], sizeof fd_set);
|
memcpy(fdt, fdsets, sizeof fdt); // one shot faster fdt init
|
||||||
memcpy(&fdt[1],&fdsets[1], sizeof fd_set);
|
|
||||||
memcpy(&fdt[2],&fdsets[2], sizeof fd_set);
|
|
||||||
if (get_wsock_mod()&& s_wsock_select(maxfd+1,&fdt[0],&fdt[1],&fdt[2],&t)) {
|
if (get_wsock_mod()&& s_wsock_select(maxfd+1,&fdt[0],&fdt[1],&fdt[2],&t)) {
|
||||||
// We got something - do the callback!
|
// We got something - do the callback!
|
||||||
for (int i = 0; i < nfds; i ++) {
|
for (int i = 0; i < nfds; i ++) {
|
||||||
|
@ -352,10 +350,8 @@ int fl_ready() {
|
||||||
t.tv_sec = 0;
|
t.tv_sec = 0;
|
||||||
t.tv_usec = 0;
|
t.tv_usec = 0;
|
||||||
fd_set fdt[3];
|
fd_set fdt[3];
|
||||||
fdt[0] = fdsets[0];
|
memcpy(fdt, fdsets, sizeof fdt);
|
||||||
fdt[1] = fdsets[1];
|
return get_wsock_mod() ? s_wsock_select(0,&fdt[0],&fdt[1],&fdt[2],&t) : 0;
|
||||||
fdt[2] = fdsets[2];
|
|
||||||
return get_wsock_mod() && s_wsock_select(0,&fdt[0],&fdt[1],&fdt[2],&t);
|
|
||||||
#endif // USE_ASYNC_SELECT
|
#endif // USE_ASYNC_SELECT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue