diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 21:39:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 21:39:38 +0100 |
commit | 0d0f76ea56975e5ecf536c59d455963d0f6742c4 (patch) | |
tree | d0a3cb5d8b15d61428382104a8084a7b7a6cc028 /libavutil/atomic_gcc.h | |
parent | d64b8540751bf8debab4ebcfad6ff87c61d3c19d (diff) | |
parent | 6327c10702922eabcb1c6170abd3f03d23ce4c51 (diff) | |
download | ffmpeg-0d0f76ea56975e5ecf536c59d455963d0f6742c4.tar.gz |
Merge commit '6327c10702922eabcb1c6170abd3f03d23ce4c51'
* commit '6327c10702922eabcb1c6170abd3f03d23ce4c51':
atomic: fix CAS with armcc.
png: use av_mallocz_array() for the zlib zalloc function
libmp3lame: use the correct remaining buffer size when flushing
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/atomic_gcc.h')
-rw-r--r-- | libavutil/atomic_gcc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/atomic_gcc.h b/libavutil/atomic_gcc.h index 84ebcab768..2bb43c3cea 100644 --- a/libavutil/atomic_gcc.h +++ b/libavutil/atomic_gcc.h @@ -21,6 +21,8 @@ #ifndef AVUTIL_ATOMIC_GCC_H #define AVUTIL_ATOMIC_GCC_H +#include <stdint.h> + #include "atomic.h" #define avpriv_atomic_int_get atomic_int_get_gcc @@ -47,7 +49,13 @@ static inline int atomic_int_add_and_fetch_gcc(volatile int *ptr, int inc) static inline void *atomic_ptr_cas_gcc(void * volatile *ptr, void *oldval, void *newval) { +#ifdef __ARMCC_VERSION + // armcc will throw an error if ptr is not an integer type + volatile uintptr_t *tmp = (volatile uintptr_t*)ptr; + return (void*)__sync_val_compare_and_swap(tmp, oldval, newval); +#else return __sync_val_compare_and_swap(ptr, oldval, newval); +#endif } #endif /* AVUTIL_ATOMIC_GCC_H */ |