Fixed compilation under Glib 2.31.x.

This commit is contained in:
Alexander Shaduri
2011-11-02 16:00:39 +00:00
parent 388a195794
commit 0ecc4bd8d3
2 changed files with 13 additions and 19 deletions
+10
View File
@@ -37,10 +37,18 @@ Bugs / patches:
TODO:
Update the man page with new options and stuff.
Change all metion of berlios.
Don't issue warnings for attributes whose raw values are not numbers completely
(e.g. they are space-separated numbers in some format)
investiage the new "-l ssd" and "-l devstat" options (since 5.42)
Add menu item - "update drive database" (not sure about linux, should
check if it's supported first; also need to run it in terminal).
@@ -122,6 +130,8 @@ RAID:
is older than "V1.46 2009-01-06", notify the user (maybe its better to grep
the smartctl output for that on port 0?).
Areca FreeBSD: unresearched. since 5.42.
3ware FreeBSD:
Call as: smartctl -i -d 3ware,[0-127] /dev/twa0 (or twe0)
Detection: unknown.
+3 -19
View File
@@ -17,30 +17,14 @@
// Glib-based policy.
// Note: g_static_mutex_*lock() functions may give warnings about breaking strict-aliasing rules.
// The warnings are completely harmless and visible on some versions of glib only.
// However, due to their number, I decided to implement this workaround.
#ifndef _WIN32
// same as stock version, but an additional cast to (void*) is added.
#define hz_glib_static_mutex_get_mutex(mutex) \
( g_thread_use_default_impl ? ((GMutex*) ((void*)((mutex)->static_mutex.pad))) : \
g_static_mutex_get_mutex_impl_shortcut(&((mutex)->runtime_mutex)) )
#else
// win32 has different definition of this macro, so default to stock version.
#define hz_glib_static_mutex_get_mutex(mutex) g_static_mutex_get_mutex(mutex)
#endif
#define hz_glib_static_mutex_lock(mutex) \
g_mutex_lock(hz_glib_static_mutex_get_mutex(mutex))
g_mutex_lock(g_static_mutex_get_mutex(mutex))
#define hz_glib_static_mutex_trylock(mutex) \
g_mutex_trylock(hz_glib_static_mutex_get_mutex(mutex))
g_mutex_trylock(g_static_mutex_get_mutex(mutex))
#define hz_glib_static_mutex_unlock(mutex) \
g_mutex_unlock(hz_glib_static_mutex_get_mutex(mutex))
g_mutex_unlock(g_static_mutex_get_mutex(mutex))