Are there any preprocessor symbols which allow something like
#if CLR_AT_LEAST_3.5
// use ReaderWriterLockSlim
#else
// use ReaderWriterLock
#endif
or some other way to do this?
I don't think there are any predefined 'preprocessor' symbols. However you can achieve what you want like this:
Create different configurations of your project, one for every version of CLR you want to support.
Choose a symbol like VERSION2
, VERSION3
etc. per CLR version.
In every configuration, define the one symbol associated with it and undefine all others.
Use these symbols in conditional compilation blocks.