projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a0ffa1
)
random-util: use gcc's bit_RDRND definition if it exists
author
Lennart Poettering
<lennart@poettering.net>
Tue, 7 May 2019 20:21:44 +0000
(16:21 -0400)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 7 May 2019 21:31:20 +0000
(17:31 -0400)
src/basic/random-util.c
patch
|
blob
|
history
diff --git
a/src/basic/random-util.c
b/src/basic/random-util.c
index de29e07549e7136f0c13b1c93d5e94fdb3a285b3..205d5501e5187c318a0bf8e24bccf8466bab06b4 100644
(file)
--- 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)