summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-internals.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2006-10-17 20:52:13 +0000
committerHavoc Pennington <hp@redhat.com>2006-10-17 20:52:13 +0000
commitf1ca9b89e92de4d876dc5e7e85710c4d2dc87638 (patch)
tree4f52c7303bd028114da11e6a8d212d4059ad2570 /dbus/dbus-internals.h
parentc4b5ea1b95f5c14fb9f51e51367d7bc9201e8b71 (diff)
2006-10-17 Havoc Pennington <hp@redhat.com>
* dbus/dbus-internals.c (_dbus_warn_check_failed): new function to be used for return_if_fail type warnings; prefixes the pid, and fatal by default.
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r--dbus/dbus-internals.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index 204ac1f9..3c8750e9 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -42,6 +42,10 @@ DBUS_BEGIN_DECLS
void _dbus_warn (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
+void _dbus_warn_check_failed (const char *format,
+ ...) _DBUS_GNUC_PRINTF (1, 2);
+
+
#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#define _DBUS_FUNCTION_NAME __func__
#elif defined(__GNUC__)
@@ -129,19 +133,19 @@ void _dbus_real_assert_not_reached (const char *explanation,
#else
extern const char _dbus_return_if_fail_warning_format[];
-#define _dbus_return_if_fail(condition) do { \
- _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
- if (!(condition)) { \
- _dbus_warn (_dbus_return_if_fail_warning_format, \
- _dbus_getpid (), _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
- return; \
+#define _dbus_return_if_fail(condition) do { \
+ _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
+ if (!(condition)) { \
+ _dbus_warn_check_failed (_dbus_return_if_fail_warning_format, \
+ _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
+ return; \
} } while (0)
#define _dbus_return_val_if_fail(condition, val) do { \
_dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
if (!(condition)) { \
- _dbus_warn (_dbus_return_if_fail_warning_format, \
- _dbus_getpid (), _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
+ _dbus_warn_check_failed (_dbus_return_if_fail_warning_format, \
+ _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
return (val); \
} } while (0)