[FFmpeg-cvslog] compat/atomics/gcc: use __typeof__ instead of typeof

James Almer git at videolan.org
Sat Mar 18 17:14:42 EET 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar  7 00:04:46 2017 -0300| [824d4062a172bd435fea7cbf8d6b55583c73e70e] | committer: James Almer

compat/atomics/gcc: use __typeof__ instead of typeof

The typeof keyword is apparently not available when using the -std=c99 option.

Fixes the use of C11 atomic functions with old GCC.

Reviewed-by: Muhammad Faiz <mfcc64 at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=824d4062a172bd435fea7cbf8d6b55583c73e70e
---

 compat/atomics/gcc/stdatomic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compat/atomics/gcc/stdatomic.h b/compat/atomics/gcc/stdatomic.h
index 41cadde..2b64687 100644
--- a/compat/atomics/gcc/stdatomic.h
+++ b/compat/atomics/gcc/stdatomic.h
@@ -100,8 +100,8 @@ do {                                    \
 
 #define atomic_exchange(object, desired)                            \
 ({                                                                  \
-    typeof(object) _obj = (object);                                 \
-    typeof(*object) _old;                                           \
+    __typeof__(object) _obj = (object);                             \
+    __typeof__(*object) _old;                                       \
     do                                                              \
         _old = atomic_load(_obj);                                   \
     while (!__sync_bool_compare_and_swap(_obj, _old, (desired)));   \
@@ -113,8 +113,8 @@ do {                                    \
 
 #define atomic_compare_exchange_strong(object, expected, desired)   \
 ({                                                                  \
-    typeof(object) _exp = (expected);                               \
-    typeof(*object) _old = *_exp;                                   \
+    __typeof__(object) _exp = (expected);                           \
+    __typeof__(*object) _old = *_exp;                               \
     *_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
     *_exp == _old;                                                  \
 })



More information about the ffmpeg-cvslog mailing list