put the SPIN_INIT and SPIN_DESTROY definitions inside the conditional