parent
445938e01d
commit
bb48d8a7e8
@ -8,16 +8,18 @@
|
|||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined (__GNUC__)
|
||||||
#define thread_local static __declspec(thread)
|
#define ATTRIBUTE_TLS static __thread
|
||||||
#elif defined __APPLE__
|
#elif defined (_MSC_VER)
|
||||||
#define thread_local static __thread
|
#define ATTRIBUTE_TLS static __declspec(thread)
|
||||||
|
#else
|
||||||
|
#error "Unknown thread local storage qualifier"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned int GetRandomSeed()
|
static unsigned int GetRandomSeed()
|
||||||
{
|
{
|
||||||
thread_local bool SeedCounterInitialized = 0;
|
ATTRIBUTE_TLS bool SeedCounterInitialized = 0;
|
||||||
thread_local unsigned int SeedCounter = 0;
|
ATTRIBUTE_TLS unsigned int SeedCounter = 0;
|
||||||
|
|
||||||
if (!SeedCounterInitialized)
|
if (!SeedCounterInitialized)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user