Fix CentOS 6 build failure
The __sync load builtins do not work with pointers to constant variables.
This commit is contained in:
parent
a0d9c7da74
commit
83ce603e3e
@ -58,7 +58,7 @@ int atomic_load_int(const int *variable)
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
return __sync_fetch_and_or((int*)variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ int32_t atomic_load_int32(const int32_t *variable)
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
return __sync_fetch_and_or((int32_t*)variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ int64_t atomic_load_int64(const int64_t *variable)
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
return __sync_fetch_and_or((int64_t*)variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ uint32_t atomic_load_uint32(const uint32_t *variable)
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
return __sync_fetch_and_or((uint32_t*)variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ uint64_t atomic_load_uint64(const uint64_t *variable)
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
return __sync_fetch_and_or((uint64_t*)variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user