forkfd: fix build with GCC 4.8 & 4.9

Prior to GCC 5.x, std::atomic_int was a typedef to __atomic_base<int>,
which meant we couldn't use it in atomic_compare_exchange that requires
pointers to std::atomic<int>. That changed in 5.x (r219790) in response
to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60940.

Easy fix, though.

Fixes: QTBUG-80896
Change-Id: I46bf1f65e8db46afbde5fffd15e1d625154f8d59
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
bb10
Thiago Macieira 2019-12-19 09:33:19 -08:00
parent 43792c50d4
commit 5034f8d8d5
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@
# define FFD_ATOMIC_ACQUIRE std::memory_order_acquire
# define FFD_ATOMIC_RELEASE std::memory_order_release
// acq_rel & cst not necessary
typedef std::atomic_int ffd_atomic_int;
typedef std::atomic<int> ffd_atomic_int;
#else
# include <stdatomic.h>
# define ffd_atomic_pointer(type) _Atomic(type*)