1
0
Fork 0
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:
nobu 2015-02-15 03:23:36 +00:00
parent 10a9807030
commit 3bc9d1d0f4

View file

@ -485,7 +485,7 @@ fill_random_bytes(void *seed, size_t size)
if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
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 (old_prov) prov = old_prov;
}