-
Notifications
You must be signed in to change notification settings - Fork 0
/
assert.js
40 lines (36 loc) · 982 Bytes
/
assert.js
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
40
const {
e,
ref,
Struct,
Func,
en,
defines,
push_export
} = require('./api');
e.SDL_ASSERTION_RETRY = en(0);
e.SDL_ASSERTION_BREAK = en();
e.SDL_ASSERTION_ABORT = en();
e.SDL_ASSERTION_IGNORE = en();
e.SDL_ASSERTION_ALWAYS_IGNORE = en();
e.SDL_AssertData = Struct({
always_ignore: 'int',
trigger_count: 'Uint',
condition: 'string',
filename: 'string',
linenum: 'int',
function: 'string',
next: 'void*'
});
e.SDL_AssertionHandler = Func('int', [ref.refType(e.SDL_AssertData), 'void*']);
push_export({
'SDL_GetDefaultAssertionHandler': [e.SDL_AssertionHandler, []],
'SDL_GetAssertionHandler': [e.SDL_AssertionHandler, ['void**']],
'SDL_SetAssertionHandler': ['void', [e.SDL_AssertionHandler, 'void*']],
'SDL_GetAssertionReport': [ref.refType(e.SDL_AssertData), []],
'SDL_ResetAssertionReport': ['void', []]
});
if (defines['SDL_ASSERT_LEVEL']) {
push_export({
'SDL_ReportAssertion': ['int', ['void*', 'string', 'string', 'int']]
});
}