On 01/21/11 18:26, Michael Roth wrote: > On 01/21/2011 10:30 AM, Jes Sorensen wrote: >> On 01/17/11 14:14, Michael Roth wrote: >>> diff --git a/qemu-ioh.c b/qemu-ioh.c >>> index cc71470..001e7a2 100644 >>> --- a/qemu-ioh.c >>> +++ b/qemu-ioh.c >>> @@ -22,7 +22,11 @@ >>> * THE SOFTWARE. >>> */ >>> #include "qemu-ioh.h" >>> +#include "qemu-char.h" >>> #include "qlist.h" >>> +#ifdef CONFIG_EVENTFD >>> +#include<sys/eventfd.h> >>> +#endif >>> >>> /* XXX: fd_read_poll should be suppressed, but an API change is >>> necessary in the character devices to suppress fd_can_read(). */ >>> @@ -113,3 +117,92 @@ void qemu_process_fd_handlers2(void >>> *ioh_record_list, const fd_set *rfds, >>> } >>> } >>> } >>> + >>> +#ifndef _WIN32 >>> +void iothread_event_increment(int *io_thread_fd) >> >> Please split the WIN32 stuff into it's own file, similar to oslib-posix >> and oslib-win32.c etc. > > Will look into this, but qemu-ioh.c has common code too so we'd end up > with qemu-ioh/qemu-ioh-posix/qemu-ioh-win2.c. We could alternatively > have a "#ifndef _WIN32" around functions in qemu-ioh.c that would be > replaced by win32-specific ones from qemu-ioh-win32. No strong > preference either way, but sometimes I find navigating across too many > files more annoying that #ifdefs, and there's not a whole lot in these.
No problem having the three files - it is far better than having #ifdefs. Having the #ifndef that is overloaded by a win32 specific file is bad, it will make it very confusing for anyone reading the code. Cheers, Jes