mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
random.c: suppress a warning
* random.c (fill_random_bytes): use ATOMIC_SIZE_CAS to suppress a strict-aliasing warning by gcc 4.9 for mingw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
10a9807030
commit
3bc9d1d0f4
1 changed files with 1 additions and 1 deletions
2
random.c
2
random.c
|
@ -485,7 +485,7 @@ fill_random_bytes(void *seed, size_t size)
|
||||||
if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
|
if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
|
||||||
prov = (HCRYPTPROV)INVALID_HANDLE_VALUE;
|
prov = (HCRYPTPROV)INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
old_prov = (HCRYPTPROV)ATOMIC_PTR_CAS(perm_prov, 0, prov);
|
old_prov = (HCRYPTPROV)ATOMIC_SIZE_CAS(perm_prov, 0, prov);
|
||||||
if (prov == (HCRYPTPROV)INVALID_HANDLE_VALUE) {
|
if (prov == (HCRYPTPROV)INVALID_HANDLE_VALUE) {
|
||||||
if (old_prov) prov = old_prov;
|
if (old_prov) prov = old_prov;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue