From: Harsh Prateek Bora Date: Thu, 7 Jun 2012 21:50:42 +0000 (+0530) Subject: trace/simple.c: fix deprecated glib2 interface X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0d665005c7fd3800f1ae590701f60fe7e4c9a57a;p=qemu.git trace/simple.c: fix deprecated glib2 interface Signed-off-by: Harsh Prateek Bora Signed-off-by: Stefan Hajnoczi --- diff --git a/trace/simple.c b/trace/simple.c index 33ae48696d..b4a3c6e950 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -161,8 +161,11 @@ static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, } timestamp = get_clock(); - +#if GLIB_CHECK_VERSION(2, 30, 0) + idx = g_atomic_int_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN; +#else idx = g_atomic_int_exchange_and_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN; +#endif trace_buf[idx] = (TraceRecord){ .event = event, .timestamp_ns = timestamp,