vcpkg/ports/libsodium/001-mingw-i386.patch
pastdue d36776f8e0
[libsodium] Fix build for emscripten and mingw-x86 (#39301)
Fixes issues compiling libsodium port for Emscripten and llvm-mingw x86.
2024-06-17 11:44:30 -07:00

22 lines
853 B
Diff

diff --git a/src/libsodium/randombytes/internal/randombytes_internal_random.c b/src/libsodium/randombytes/internal/randombytes_internal_random.c
--- a/src/libsodium/randombytes/internal/randombytes_internal_random.c
+++ b/src/libsodium/randombytes/internal/randombytes_internal_random.c
@@ -45,7 +45,7 @@
# include <poll.h>
#endif
#ifdef HAVE_RDRAND
-# ifdef __clang__
+# if defined (__clang__) && (!defined(__MINGW32__) || !defined(__i386__))
# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function)
# elif defined(__GNUC__)
# pragma GCC target("rdrnd")
@@ -639,7 +639,7 @@ struct randombytes_implementation randombytes_internal_implementation = {
};
#ifdef HAVE_RDRAND
-# ifdef __clang__
+# if defined (__clang__) && (!defined(__MINGW32__) || !defined(__i386__))
# pragma clang attribute pop
# endif
#endif