aboutsummaryrefslogtreecommitdiff
path: root/bbot/agent
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-21 07:02:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-21 07:02:36 +0200
commitaf1285bdf7a0365bae5bf23f4022abbc0d2cb526 (patch)
tree6609a099dd3364567bb03ff1f837dd2e9e0ec2de /bbot/agent
parentca35746ba41437b1ced31d689ec51203c960bfb4 (diff)
Make compilable on Windows
Diffstat (limited to 'bbot/agent')
-rw-r--r--bbot/agent9
1 files changed, 9 insertions, 0 deletions
diff --git a/bbot/agent b/bbot/agent
index 1271a87..b88c892 100644
--- a/bbot/agent
+++ b/bbot/agent
@@ -26,6 +26,15 @@ namespace bbot
extern uid_t uid; // Our effective user id.
extern string uname; // Our effective user name.
+ // Random number generator (currently not MT-safe and limited to RAND_MAX).
+ //
+ size_t
+ genrand ();
+
+ template <typename T>
+ inline T
+ genrand () {return static_cast<T> (genrand ());}
+
// Return the IPv4 address of an interface.
//
string