// file : bbot/utility.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : TBC; see accompanying LICENSE file #include #include #include // rand_r() #include using namespace std; using namespace butl; namespace bbot { static unsigned int rand_seed; // Seed for rand_r(); size_t genrand () { if (rand_seed == 0) rand_seed = static_cast ( chrono::system_clock::now ().time_since_epoch ().count ()); return static_cast (rand_r (&rand_seed)); } void run_trace (tracer& t, const char* cmd[], size_t n) { if (verb >= 3) { diag_record dr (t); process::print (dr.os, cmd, n); } } }