* src/c++11/random.cc (random_device::_M_getentropy): Use __CHAR_BIT__
instead of fixed number of bits.
From-SVN: r248428
+2017-05-24 Jonathan Wakely <jwakely@redhat.com>
+
+ * src/c++11/random.cc (random_device::_M_getentropy): Use __CHAR_BIT__
+ instead of fixed number of bits.
+
2017-05-24 Andreas Schwab <schwab@suse.de>
* config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Update.
if (ent < 0)
return 0.0;
- if (static_cast<unsigned>(ent) > sizeof(result_type) * 8)
- return static_cast<double>(sizeof(result_type) * 8);
+ const int max = sizeof(result_type) * __CHAR_BIT__;
+ if (ent > max)
+ ent = max;
return static_cast<double>(ent);
#else