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.
No, in portable C, there is no way to take commands while the engine is searching. The only way would be with some extensions of the language. Therefore, you need compilers that have the same extensions for the OS's that you are targeting your program. Maybe if you use Cygwin and GCC for windows and Linux? But there is no way that you may find a way to do it truly OS independant.
I am using threads. They are not really portable, but you can do it in a way that you have very few different lines of code.
Miguel