*/
int mowgli_argstack_pop_numeric(mowgli_argstack_t *self)
{
- return_val_if_fail(self != NULL, 0)
+ return_val_if_fail(self != NULL, 0);
mowgli_node_t *n;
mowgli_argstack_element_t *e;
#ifndef __MOWGLI_ASSERT_H__
#define __MOWGLI_ASSERT_H__
-#define _assert_msg(x) "sssertion '#x' failed."
+#define _assert_msg(exp) "assertion '#exp' failed."
-#define soft_assert(x, ...) \
- if (!(x)) { \
- mowgli_log_warning(_assert_msg(x), ##__VA_ARGS__); \
- }
+#define soft_assert(exp) \
+ do { \
+ if (!(exp)) { \
+ mowgli_log_warning(_assert_msg(exp)); \
+ } \
+ } while(0)
-#define return_if_fail(x, ...) \
- if (!(x)) { \
- mowgli_log_warning(_assert_msg(x), ##__VA_ARGS__); \
- return; \
- }
+#define return_if_fail(exp) \
+ do { \
+ if (!(exp)) { \
+ mowgli_log_warning(_assert_msg(exp)); \
+ return; \
+ } \
+ } while(0)
-#define return_val_if_fail(x, y, ...) \
- if (!(x)) { \
- mowgli_log_warning(_assert_msg(x), ##__VA_ARGS__); \
- return (y); \
- }
+#define return_val_if_fail(exp, val) \
+ do { \
+ if (!(exp)) { \
+ mowgli_log_warning(_assert_msg(exp)); \
+ return (val); \
+ } \
+ } while(0)
-#define return_null_if_fail(x, ...) return_val_if_fail(x, NULL, ##__VA_ARGS__);
+#define return_null_if_fail(exp) return_val_if_fail(exp, NULL)
#endif
int mowgli_vio_default_tell(mowgli_vio_t *vio)
{
- return_val_if_fail(vio, -255)
+ return_val_if_fail(vio, -255);
vio->error.op = MOWGLI_VIO_ERR_OP_TELL;
errno = ENOSYS;
return mowgli_vio_err_errcode(vio, strerror, errno);