blob: f30c12c0fa64f1e03911c3b26878241b901ac233 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef NDEBUG
#include <assert.h>
#include "ui.internal.h"
struct ui_window_base *ui__check_cast_to_base(void *obj)
{
return obj; /* this cast always succeeds */
}
struct ui_window_dock *ui__check_cast_to_dock(void *obj)
{
struct ui_window_base *base = obj;
assert(base->type == UI__WINDOW_TYPE_DOCK);
return obj;
}
struct ui_window_root *ui__check_cast_to_root(void *obj)
{
struct ui_window_base *base = obj;
assert(base->type == UI__WINDOW_TYPE_ROOT);
return obj;
}
#else
/* the file must have a declaration */
void umps__debug_do_nothing(void)
{
}
#endif
|