How about this. Use #ifdef stuff so that when building on WINE, it uses unix sockets. But when building on win32 (which would include MingW and ReactOS), it uses winsock.