diff --git a/Sources/Cbsspeke/bsspeke.c b/Sources/Cbsspeke/bsspeke.c
index fc83abe89117d69dc5c7c1e7ba17191f1596372e..b7fab2c6add2821069362f2e4e80d0ecbfc80f8a 100644
--- a/Sources/Cbsspeke/bsspeke.c
+++ b/Sources/Cbsspeke/bsspeke.c
@@ -22,7 +22,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#if defined(__linux__)
 #include <sys/random.h>
+#endif
 
 /*
 For Emscripten compilation to Javascript use the following: