summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-internals.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-01-17 00:16:28 +0000
committerHavoc Pennington <hp@redhat.com>2005-01-17 00:16:28 +0000
commitaad6fa897f85486386b030847151cb09943c97c0 (patch)
tree3996469d2be2df0bc63a4e8dd0aa3ac6cdfaddcb /dbus/dbus-internals.h
parent7f9721a6d36697a57170c604aa845af3531bd157 (diff)
2005-01-16 Havoc Pennington <hp@redhat.com>
* dbus/dbus-internals.c (_dbus_real_assert): print the function name the assertion failed in * dbus/dbus-internals.h (_dbus_return_if_fail) (_dbus_return_val_if_fail): assert that the name of the function containing the check doesn't start with '_', since we only want to use checks on public functions * dbus/dbus-connection.c (_dbus_connection_ref_unlocked): change checks to assertions * dbus/dbus-marshal-header.c (_dbus_header_set_field_basic): change checks to asserts for private function * dbus/dbus-message.c (_dbus_message_set_serial): checks to asserts for private function * dbus/dbus-marshal-recursive.c (skip_one_complete_type): remove broken assertion that was breaking make check (_dbus_type_reader_array_is_empty): remove this rather than fix it, was only used in assertions
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r--dbus/dbus-internals.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index d1c65615..5d6f31f2 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -100,9 +100,10 @@ const char* _dbus_strerror (int error_number);
void _dbus_real_assert (dbus_bool_t condition,
const char *condition_text,
const char *file,
- int line);
+ int line,
+ const char *func);
#define _dbus_assert(condition) \
- _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__)
+ _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__, _DBUS_FUNCTION_NAME)
#endif /* !DBUS_DISABLE_ASSERT */
#ifdef DBUS_DISABLE_ASSERT
@@ -122,6 +123,7 @@ void _dbus_real_assert_not_reached (const char *explanation,
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__); \
@@ -129,6 +131,7 @@ extern const char _dbus_return_if_fail_warning_format[];
} } 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__); \