From 5cf7cf5abaa8fe42c2dcd1d88f841f710af509a0 Mon Sep 17 00:00:00 2001 From: alittlehorse Date: Tue, 14 Mar 2023 20:06:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?#issue1446=20:=20=E4=BF=AE=E5=A4=8Dx86=20ub?= =?UTF-8?q?untu16=20=E9=93=BE=E6=8E=A5=5Frdseed64=5Fstep=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rdrand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rdrand.c b/src/rdrand.c index 1dc3f8e1d..d0dd8cdfb 100644 --- a/src/rdrand.c +++ b/src/rdrand.c @@ -13,6 +13,7 @@ #include #include #include +#include int rdrand_bytes(uint8_t *buf, size_t buflen) { From f7cc6ed0d5c3a3ba4c03ef5ed1dfe2a42a13aa50 Mon Sep 17 00:00:00 2001 From: alittlehorse Date: Wed, 15 Mar 2023 20:46:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?#issue1446=20:=20=E4=BF=AE=E5=A4=8Dx86=20ub?= =?UTF-8?q?untu16=20=E9=93=BE=E6=8E=A5=5Frdseed64=5Fstep=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rdrand.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rdrand.c b/src/rdrand.c index 1dc3f8e1d..735d426f3 100644 --- a/src/rdrand.c +++ b/src/rdrand.c @@ -13,6 +13,9 @@ #include #include #include +#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) +#include +#endif int rdrand_bytes(uint8_t *buf, size_t buflen) { From 3003e0bab0998377604ef84d3c2e7a0e33724176 Mon Sep 17 00:00:00 2001 From: alittlehorse Date: Wed, 15 Mar 2023 22:08:17 +0800 Subject: [PATCH 3/5] move immintrin.h under the macro --- src/rdrand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdrand.c b/src/rdrand.c index 735d426f3..780832e1a 100644 --- a/src/rdrand.c +++ b/src/rdrand.c @@ -12,8 +12,8 @@ #include #include #include -#include #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) +#include #include #endif From 6aab35af2508e8fa487c0897d1c5f9dfedeff05b Mon Sep 17 00:00:00 2001 From: alittlehorse Date: Thu, 16 Mar 2023 12:45:07 +0800 Subject: [PATCH 4/5] add gcc version check --- src/rdrand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdrand.c b/src/rdrand.c index 780832e1a..d7c7b42fc 100644 --- a/src/rdrand.c +++ b/src/rdrand.c @@ -12,8 +12,8 @@ #include #include #include -#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) #include +#if defined(__GNUC__) && (__GNUC_MAJOR__ > 4 || (__GNUC_MAJOR__ == 4 && __GNUC_MINOR__ >= 6)) #include #endif From 48282f9e1f8205dcbb5fb8d702c2a8b6e64a1ffe Mon Sep 17 00:00:00 2001 From: alittlehorse Date: Thu, 16 Mar 2023 19:42:55 +0800 Subject: [PATCH 5/5] repleace __GNUC_MAJOR__ with __GNUC__ --- src/rdrand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdrand.c b/src/rdrand.c index d7c7b42fc..77ce4bd12 100644 --- a/src/rdrand.c +++ b/src/rdrand.c @@ -13,7 +13,7 @@ #include #include #include -#if defined(__GNUC__) && (__GNUC_MAJOR__ > 4 || (__GNUC_MAJOR__ == 4 && __GNUC_MINOR__ >= 6)) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #include #endif