提交 cb4b54c2 编写于 作者: R Richard Levitte 提交者: Matt Caswell

Check for __GNUC__ to use GNU C atomic buildins

Note: we trust any other compiler that fully implements GNU extension
to define __GNUC__

RT#4642
Reviewed-by: NAndy Polyakov <appro@openssl.org>
上级 63db6b77
......@@ -109,9 +109,9 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
{
#ifdef __ATOMIC_RELAXED
# if defined(__GNUC__) && defined(__ATOMIC_RELAXED)
*ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
#else
# else
if (!CRYPTO_THREAD_write_lock(lock))
return 0;
......@@ -120,7 +120,7 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
if (!CRYPTO_THREAD_unlock(lock))
return 0;
#endif
# endif
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册