blob: 6d3ea5de6354e97e251603273593989762e5513f (
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
34
35
36
37
38
39
|
#ifndef NDEBUG
#include "../macros.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_leaf *ui__check_cast_to_leaf(void *obj)
{
struct ui_window_base *base = obj;
umps_assert(base->type == UI__WINDOW_TYPE_LEAF);
return obj;
}
struct ui_window_dock *ui__check_cast_to_dock(void *obj)
{
struct ui_window_base *base = obj;
umps_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;
umps_assert(base->type == UI__WINDOW_TYPE_ROOT);
return obj;
}
#else
/* the file must have a declaration */
void umps__debug_do_nothing(void)
{
}
#endif
|