void setExceptionCallback(void (*callback)(void));
void resetExceptionCallback(void);
+/**
+ * Returns a pseudo-random integer in the range 0 to RAND_MAX.
+ */
+static inline int
+random(void) {
+#ifdef _WIN32
+ return ::rand();
+#else
+ return ::random();
+#endif
+}
+
} /* namespace os */
#endif /* _OS_HPP_ */
#include <stdlib.h>
#include <limits>
+#include "os.hpp"
#include "trace_fast_callset.hpp"
using namespace trace;
random_level (void)
{
/* tricky bit -- each bit is '1' 75% of the time */
- long int bits = random() | random();
+ long int bits = os::random() | os::random();
int level = 1;
while (level < MAX_LEVEL)