OS Independent Winboard/Xboard implementation

Does anyone know an OS independant C implementation of the Winboard/Xboard protocol in such a way that an engine takes commands while searching?
Methods using polling or threads seem to be OS dependant.
Yes it it possible to use #ifdef's and such but I'm am talking about a single exe working on most Operating Systems.
Methods using polling or threads seem to be OS dependant.
Yes it it possible to use #ifdef's and such but I'm am talking about a single exe working on most Operating Systems.