Use size_t and ptrdiff_t from std namespace

The types were assumed to be in the global scope in many places.
Merge TI DSP compiler support patch from Vesa Peltonen (timers).