--- a/src/c/threads/atomic.d
+++ b/src/c/threads/atomic.d
@@ -17,6 +17,7 @@
 
 #include <ecl/ecl.h>
 #include <ecl/internal.h>
+#include "threads/ecl_atomics.h"
 
 #ifdef ECL_THREADS