make ifdefs more delphi compatible + cleanup of unneeded ifdefs