7zip/CPP/Common/Random.cpp
Igor Pavlov f19f813537 '21.07'
2022-03-18 15:35:13 +05:00

29 lines
388 B
C++

// Common/Random.cpp
#include "StdAfx.h"
#include <stdlib.h>
#ifndef _WIN32
#include <time.h>
#else
#include "MyWindows.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(); }