glib-compat.h: change assert to g_assert
PATCH 1/1 glib-compat.h: change assert to g_assert
include/glib-compat.h defines a bunch of functions based on glib primitives, and uses assert() without including assert.h. Replace assert() with g_assert() to make the file more self-contained, and to fix compilation breakage after 28507a415a9b1e.
Reported-by Laurent Desnogues <[email protected]>
Signed-off-by Michael Tokarev <[email protected]>
--- include/glib-compat.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/glib-compat.h +3 -3
@@ -115,7 +115,7 @@ static inline void g_mutex_init(CompatGMutex *mutex)static inline void g_mutex_clear (CompatGMutex *mutex) { -assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS );if (mutex->once.retval) {g_mutex_free ((GMutex *) mutex->once.retval); }
@@ -155,7 +155,7 @@ static inline void g_cond_init(CompatGCond *cond)static inline void g_cond_clear (CompatGCond *cond) { -assert (cond->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (cond->once.status !=G_ONCE_STATUS_PROGRESS );if (cond->once.retval) {g_cond_free ((GCond *) cond->once.retval); }
@@ -164,7 +164,7 @@ static inline void g_cond_clear(CompatGCond *cond)static inline void (g_cond_wait)(CompatGCond *cond,CompatGMutex *mutex) { -assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS );g_once (&cond->once, do_g_cond_new,NULL );g_cond_wait ((GCond *) cond->once.retval, (GMutex *) mutex->once.retval); }
Signature · 1 line
2.1.4
Hello,
Quoted 7 lines · Michael Tokarev
include/glib-compat.hdefines a bunch of functions based on glib primitives, and usesassert()without includingassert.h. Replaceassert()withg_assert()to make the file more self-contained, and to fix compilation breakage after28507a415a9b1e.Reported-by Laurent Desnogues <[email protected]>Signed-off-by Michael Tokarev <[email protected]>
Tested-by Laurent Desnogues <[email protected]>
Thanks,
Laurent
Quoted 39 lines
--- include/glib-compat.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)include/glib-compat.h +3
-4@@ -115,7 +115,7 @@ static inline void g_mutex_init(CompatGMutex *mutex)static inline void g_mutex_clear (CompatGMutex *mutex) { -assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS );if (mutex->once.retval) {g_mutex_free ((GMutex *) mutex->once.retval); }@@ -155,7 +155,7 @@ static inline void g_cond_init(CompatGCond *cond)static inline void g_cond_clear (CompatGCond *cond) { -assert (cond->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (cond->once.status !=G_ONCE_STATUS_PROGRESS );if (cond->once.retval) {g_cond_free ((GCond *) cond->once.retval); }@@ -164,7 +164,7 @@ static inline void g_cond_clear(CompatGCond *cond)static inline void (g_cond_wait)(CompatGCond *cond,CompatGMutex *mutex) { -assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS ); +g_assert (mutex->once.status !=G_ONCE_STATUS_PROGRESS );g_once (&cond->once, do_g_cond_new,NULL );g_cond_wait ((GCond *) cond->once.retval, (GMutex *) mutex->once.retval); } --2.1.4