Port to Windows. This is mostly glue layers for the poor POSIX support

on Windows. A few notes

 * Only sockets behave somewhat like file descriptors in UNIX.

 * There are no fixed paths. Closes thing is environment variables that point
   to system directories. We also figure out where the binary/dll is
   located and use that as configuration directory.


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@418 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-01-05 22:51:37 +00:00
parent 2f74bb9d43
commit 19d9fcbda8
22 changed files with 712 additions and 58 deletions

View file

@ -36,6 +36,17 @@
#include <sys/select.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#define EBADF WSAEBADF
#define ESHUTDOWN WSAESHUTDOWN
#define ECONNRESET WSAECONNRESET
#define ECONNABORTED WSAECONNABORTED
#define ENETRESET WSAENETRESET
#endif /* HAVE_WINSOCK2_H */
#ifndef HAVE_SYS_POLL_H
#include "util.h"
@ -59,7 +70,16 @@ int poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
return 0;
}
#ifdef OS_IS_WIN32
/*
* Windows does not support signals properly so waiting for them would
* mean a deadlock.
*/
pa_msleep(100);
return 0;
#else
return select(0, NULL, NULL, NULL, NULL);
#endif
}
for (f = fds; f < &fds[nfds]; ++f) {
@ -138,6 +158,10 @@ int poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
}
}
#ifdef OS_IS_WIN32
errno = WSAGetLastError();
#endif
if (ready > 0) {
ready = 0;
for (f = fds; f < &fds[nfds]; ++f) {