Probably by mistake, SMPlayer requires a C99 feature (statement before declaration) to compile. I think if possible (and it's trivial) it should compile with older C89-only compilers (e.g. the default compiler on Haiku).
Attached is a patch that fixes this.
Move warning-avoidance code to be C89-compatible