]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
use #pragma comment(lib) with _MSC_VER only
authorViktor Szakats <commit@vsz.me>
Sun, 3 Jul 2022 22:30:06 +0000 (22:30 +0000)
committerTomas Mraz <tomas@openssl.org>
Mon, 11 Jul 2022 08:36:28 +0000 (10:36 +0200)
Avoid this warning when compiled with llvm/gcc + mingw-w64 and
`USE_BCRYPTGENRANDOM` enabled:

```
../providers/implementations/rands/seeding/rand_win.c:31:11: warning: unknown pragma ignored [-Wunknown-pragmas]
          ^
1 warning generated.
```

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18709)

providers/implementations/rands/seeding/rand_win.c

index 704705425a6dee88dab1119ea326faf9d29c420a..a21b74dd868548050705fb9dd7a9b3cccf552142 100644 (file)
@@ -28,7 +28,9 @@
 
 # ifdef USE_BCRYPTGENRANDOM
 #  include <bcrypt.h>
-#  pragma comment(lib, "bcrypt.lib")
+#  ifdef _MSC_VER
+#   pragma comment(lib, "bcrypt.lib")
+#  endif
 #  ifndef STATUS_SUCCESS
 #   define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
 #  endif