diff --git a/tasks/task_save.c b/tasks/task_save.c
index 145157c7f6..9b10ffd4ba 100644
--- a/tasks/task_save.c
+++ b/tasks/task_save.c
@@ -142,10 +142,10 @@ static struct save_state_buf undo_save_buf;
  * Can be restored with undo_load_state(). */
 static struct save_state_buf undo_load_buf;
 
+#ifdef HAVE_THREADS
 /* TODO/FIXME - global state - perhaps move outside this file */
 static struct autosave_st autosave_state;
 
-#ifdef HAVE_THREADS
 /**
  * autosave_thread:
  * @data            : pointer to autosave object