Splitting RS.cpp into platform-independent and platform-dependent
parts, FS#1050.