Files
easy7zip/CPP/Common/Random.cpp
Igor Pavlov c99f3ebdd6 9.06 beta
2016-05-28 00:16:00 +01:00

27 lines
359 B
C++
Executable File

// Common/Random.cpp
#include "StdAfx.h"
#include <stdlib.h>
#ifndef _WIN32
#include <time.h>
#endif
#include "Random.h"
void CRandom::Init(unsigned int seed) { srand(seed); }
void CRandom::Init()
{
Init((unsigned int)
#ifdef _WIN32
GetTickCount()
#else
time(NULL)
#endif
);
}
int CRandom::Generate() const { return rand(); }