diff --git a/src/basic/random-util.c b/src/basic/random-util.c index de29e07549..205d5501e5 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -45,7 +45,12 @@ int rdrand(unsigned long *ret) { return -EOPNOTSUPP; } - have_rdrand = !!(ecx & (1U << 30)); +/* Compat with old gcc where bit_RDRND didn't exist yet */ +#ifndef bit_RDRND +#define bit_RDRND (1U << 30) +#endif + + have_rdrand = !!(ecx & bit_RDRND); } if (have_rdrand == 0)