diff options
author | Naios <naios-dev@live.de> | 2016-03-22 19:58:32 +0100 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2016-03-24 02:45:44 +0100 |
commit | 1a1c0d1dc4b5476bd438585e8b16466101ad509a (patch) | |
tree | 2e37535ef1c9cc371a0182e305919e0d3aeedc48 /src/common/Utilities/Random.h | |
parent | 77aa9ae01d6681be747f0bfbb3e593cc6ce7c757 (diff) |
Core/Common: Converted the common library to a shared library.
* There is still the possibility to static link against common.
(cherry picked from commit 501fd9b50232ca3ae3623877c3e521c9c1f894be)
Diffstat (limited to 'src/common/Utilities/Random.h')
-rw-r--r-- | src/common/Utilities/Random.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index 5dea6117f97..b3ca00219ef 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -24,28 +24,28 @@ #include <random> /* Return a random number in the range min..max. */ -int32 irand(int32 min, int32 max); +TC_COMMON_API int32 irand(int32 min, int32 max); /* Return a random number in the range min..max (inclusive). */ -uint32 urand(uint32 min, uint32 max); +TC_COMMON_API uint32 urand(uint32 min, uint32 max); /* Return a random millisecond value between min and max seconds. Functionally equivalent to urand(min*IN_MILLISECONDS, max*IN_MILLISECONDS). */ -uint32 urandms(uint32 min, uint32 max); +TC_COMMON_API uint32 urandms(uint32 min, uint32 max); /* Return a random number in the range 0 .. UINT32_MAX. */ -uint32 rand32(); +TC_COMMON_API uint32 rand32(); /* Return a random time in the range min..max (up to millisecond precision). Only works for values where millisecond difference is a valid uint32. */ -Milliseconds randtime(Milliseconds const& min, Milliseconds const& max); +TC_COMMON_API Milliseconds randtime(Milliseconds const& min, Milliseconds const& max); /* Return a random number in the range min..max */ -float frand(float min, float max); +TC_COMMON_API float frand(float min, float max); /* Return a random double from 0.0 to 1.0 (exclusive). */ -double rand_norm(); +TC_COMMON_API double rand_norm(); /* Return a random double from 0.0 to 100.0 (exclusive). */ -double rand_chance(); +TC_COMMON_API double rand_chance(); /* Return true if a random roll fits in the specified chance (range 0-100). */ inline bool roll_chance_f(float chance) @@ -62,7 +62,7 @@ inline bool roll_chance_i(int chance) /* * SFMT wrapper satisfying UniformRandomNumberGenerator concept for use in <random> algorithms */ -class SFMTEngine +class TC_COMMON_API SFMTEngine { public: typedef uint32 result_type; |