I think you have turned on (or off) #define's such that the function declaration structure is broken.

Functions need to look like:

Code:
type  name(parameters) {
...
}
If you try to declare a new function in the middle of that sequence, you will get the type of errors you are seeing.

This is kind of a lame cop-out. But if you start with the unaltered stepper.cpp file and start deleting thing you know you don't need, it will simplify the code. For example, if you know you are not going to use

#ifdef CONFIG_STEPPERS_TOSHIBA

Then delete the #ifdef and everything up to and including the #endif. Go through the diffrerent #ifdef's and anything you know you don't need, manually edit it out. Probably the code will become much simpler and you will be able to re-use it easier.