I understand the precept as a restraint against anything that will A) cloud judgement and lead to unskilful behaviour, for example getting drunk and being aggressive.
B) consuming anything that increased craving. That would include heroin, cocaine, caffeine, nicotine and even painkillers.
Obviously Buddha didn't know about caffeine and nicotine, or even cocaine and heroin, because he wasnt all knowing but I do believe that if he did know about them he would prohibit them (obviously heroin and cocaine is a given).
If you do a thought experiment can you really imagine Buddha saying its ok to smoke, or using caffeine to stay awake it's skilful?
Unbowed, Unbent, Unbroken