duplicating the code is ok if you really must (although i'd just ifdef the bits you need to change), but at least keep the ifdef inside the method definition so if you need to change the signature it's easy to do so?