mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 06:14:28 +08:00
Remove further unused code after 12da87b
This commit is contained in:
@@ -1027,39 +1027,6 @@ void Fl_WinAPI_System_Driver::awake(void* msg) {
|
|||||||
PostThreadMessage( main_thread, fl_wake_msg, (WPARAM)msg, 0);
|
PostThreadMessage( main_thread, fl_wake_msg, (WPARAM)msg, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create anonymous pipe in the form of 2 unix-style file descriptors
|
|
||||||
static void pipe_win32(int fds[2]) {
|
|
||||||
HANDLE read_h, write_h;
|
|
||||||
SECURITY_ATTRIBUTES sa;
|
|
||||||
sa.nLength = sizeof(sa);
|
|
||||||
sa.lpSecurityDescriptor = NULL;
|
|
||||||
sa.bInheritHandle = true;
|
|
||||||
if (CreatePipe(&read_h, &write_h, &sa, 0) == 0) {
|
|
||||||
fds[0] = fds[1] = -1; // indicates error
|
|
||||||
} else { // create unix-style file descriptors from handles
|
|
||||||
fds[0] = _open_osfhandle((fl_intptr_t)read_h, _O_RDONLY | _O_BINARY);
|
|
||||||
fds[1] = _open_osfhandle((fl_intptr_t)write_h, _O_WRONLY | _O_BINARY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct gunz_data { // data transmitted to thread
|
|
||||||
const unsigned char *data;
|
|
||||||
unsigned length;
|
|
||||||
int fd;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void __cdecl write_func(struct gunz_data *pdata) { // will run in child thread
|
|
||||||
//const unsigned char *from = pdata->data;
|
|
||||||
while (pdata->length > 0) {
|
|
||||||
int done = _write(pdata->fd, pdata->data, pdata->length);
|
|
||||||
if (done == -1) break;
|
|
||||||
pdata->length -= done;
|
|
||||||
pdata->data += done;
|
|
||||||
}
|
|
||||||
_close(pdata->fd);
|
|
||||||
free(pdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
int Fl_WinAPI_System_Driver::close_fd(int fd) {
|
int Fl_WinAPI_System_Driver::close_fd(int fd) {
|
||||||
return _close(fd);
|
return _close(fd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user