diff options
author | Brad King <brad.king@kitware.com> | 2011-05-17 10:07:26 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-05-17 10:07:26 -0400 |
commit | e1b0a11dd471e1593ade56897185a9d4dd2e0857 (patch) | |
tree | b0f1efae3ec53531386f148ce75098e40d2b1e96 /Source/cmSystemTools.h | |
parent | a77dfb6d64b24737167e4a0312fb842544f27961 (diff) | |
download | cmake-e1b0a11dd471e1593ade56897185a9d4dd2e0857.tar.gz |
Improve string(RANDOM) default seed
The naive time(0) seed is unique only within one second. Instead try to
read a real source of entropy and otherwise fall back to a combination
of the process id and high-resolution time.
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 6f9147c318..78b9abf2f6 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -402,6 +402,9 @@ public: static bool FileTimeGet(const char* fname, cmSystemToolsFileTime* t); static bool FileTimeSet(const char* fname, cmSystemToolsFileTime* t); + /** Random seed generation. */ + static unsigned int RandomSeed(); + /** Find the directory containing the running executable. Save it in a global location to be queried by GetExecutableDirectory later. */ |