How to specify a timer's name depending on the chip it will be compiled to?
Just as a complement to Delta_G's answer:

The names TIMSK0, OCIE0A, etc. are already preprocessor macros
so, for consistency, it makes sense to define your own preprocessor
macros for them. I tend to be lazy and use one of the already defined
names, like
#ifdef TIMSK0  // support both ATtiny{25,45,85} and ATmega328P
# define TIMSK TIMSK0
#endif

A const pointer for &amp;TIMSK0 is fine though.

The macros identifying the MCU are defined to the value 1. Thus you
have the choice between these three idioms:
#ifdef __AVR_ATtiny45__
...
#endif

#if defined(__AVR_ATtiny45__)
...
#endif

#if __AVR_ATtiny45__
...
#endif

The third one is convenient when you want to address several MCU
models with the same code:
#if __AVR_ATtiny25__ || __AVR_ATtiny45__ || __AVR_ATtiny85__
...
#endif