mirror of git://git.sysmocom.de/ofono
gdbus: Use gcc builtin instead of g_atomic
g_atomic_* end up using G_STATIC_ASSERT, causing gcc 4.8 to yell due to -Wunused-local-typedefs. gdbus/client.c: In function ‘g_dbus_client_ref’: /usr/include/glib-2.0/glib/gmacros.h:162:53: error: typedef ‘_GStaticAssertCompileTimeAssertion_2’ locally defined but not used [-Werror=unused-local-typedefs] #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1]
This commit is contained in:
parent
a36ffa872a
commit
de4aa7266b
|
@ -33,7 +33,7 @@
|
||||||
#define METHOD_CALL_TIMEOUT (300 * 1000)
|
#define METHOD_CALL_TIMEOUT (300 * 1000)
|
||||||
|
|
||||||
struct GDBusClient {
|
struct GDBusClient {
|
||||||
gint ref_count;
|
int ref_count;
|
||||||
DBusConnection *dbus_conn;
|
DBusConnection *dbus_conn;
|
||||||
char *service_name;
|
char *service_name;
|
||||||
char *unique_name;
|
char *unique_name;
|
||||||
|
@ -54,7 +54,7 @@ struct GDBusClient {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GDBusProxy {
|
struct GDBusProxy {
|
||||||
gint ref_count;
|
int ref_count;
|
||||||
GDBusClient *client;
|
GDBusClient *client;
|
||||||
char *obj_path;
|
char *obj_path;
|
||||||
char *interface;
|
char *interface;
|
||||||
|
@ -447,7 +447,7 @@ GDBusProxy *g_dbus_proxy_ref(GDBusProxy *proxy)
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
g_atomic_int_inc(&proxy->ref_count);
|
__sync_fetch_and_add(&proxy->ref_count, 1);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ void g_dbus_proxy_unref(GDBusProxy *proxy)
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_atomic_int_dec_and_test(&proxy->ref_count) == FALSE)
|
if (__sync_sub_and_fetch(&proxy->ref_count, 1) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_hash_table_destroy(proxy->prop_list);
|
g_hash_table_destroy(proxy->prop_list);
|
||||||
|
@ -1268,7 +1268,7 @@ GDBusClient *g_dbus_client_ref(GDBusClient *client)
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
g_atomic_int_inc(&client->ref_count);
|
__sync_fetch_and_add(&client->ref_count, 1);
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
@ -1280,7 +1280,7 @@ void g_dbus_client_unref(GDBusClient *client)
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_atomic_int_dec_and_test(&client->ref_count) == FALSE)
|
if (__sync_sub_and_fetch(&client->ref_count, 1) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (client->pending_call != NULL) {
|
if (client->pending_call != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue