summaryrefslogtreecommitdiffstats
path: root/other-licenses/7zstub/src/Common/Random.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other-licenses/7zstub/src/Common/Random.cpp')
-rw-r--r--other-licenses/7zstub/src/Common/Random.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/other-licenses/7zstub/src/Common/Random.cpp b/other-licenses/7zstub/src/Common/Random.cpp
new file mode 100644
index 000000000..85d275c23
--- /dev/null
+++ b/other-licenses/7zstub/src/Common/Random.cpp
@@ -0,0 +1,17 @@
+// Common/Random.cpp
+
+#include "StdAfx.h"
+
+#include <time.h>
+#include <stdlib.h>
+
+#include "Common/Random.h"
+
+void CRandom::Init(unsigned int seed)
+ { srand(seed); }
+
+void CRandom::Init()
+ { Init((unsigned int)time(NULL)); }
+
+int CRandom::Generate() const
+ { return rand(); }