I Have 2 classes "Writerthread" and "readerThread".
I have 2 other classes "WinThread" & "LinuxThread" which are base classes for the Writerthread" and "readerThread".

I want to derive these classes say,

class WriterThreadublic WinThread or
class WriterThreadublic LinuxThread

The problem is I want to do it dynamically.The writerthread should derive from 1 of these classes,depending on the operating system(ie:wheather it is linux or windows).In the main(), Iam using a
#ifdef _LINUX_
#endif
#ifdef _WIN_VER
#endif
I need an architecture so that I can derive from 1 of these classes dynamically.
I dont want to use #ifdef inside the classes

Thanks