Split off gc-random from gc, and only warn on missing devices.
[gnulib.git] / lib / gc-gnulib.c
index c0fa2e3..111c4a1 100644 (file)
@@ -1,5 +1,5 @@
-/* gc-gl-common.c --- Common gnulib internal crypto interface functions
- * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
+/* gc-gnulib.c --- Common gnulib internal crypto interface functions
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006  Simon Josefsson
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
 #include <string.h>
 
 /* For randomize. */
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
+#ifdef GC_USE_RANDOM
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# include <errno.h>
+#endif
 
 /* Hashes. */
 #ifdef GC_USE_MD2
@@ -80,6 +82,8 @@ gc_done (void)
   return;
 }
 
+#ifdef GC_USE_RANDOM
+
 /* Randomness. */
 
 static Gc_rc
@@ -152,6 +156,8 @@ gc_random (char *data, size_t datalen)
   return randomize (2, data, datalen);
 }
 
+#endif
+
 /* Memory allocation. */
 
 void