Ticket #12162: debug.h

File debug.h, 709 bytes (added by haiqu, 4 years ago)

Replacement debug.h

Line 
1/*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef DEBUG_H
6#define DEBUG_H
7
8
9#include <stdarg.h>
10
11#include <SupportDefs.h>
12
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18void debug_init_post_mmu(void);
19void debug_cleanup(void);
20void kprintf(const char *format, ...);
21
22#ifdef __cplusplus
23}
24#endif
25
26/* STATIC_ASSERT is a compile-time check that can be used to             */
27/* verify static expressions such as: STATIC_ASSERT(sizeof(int64) == 8); */
28#define STATIC_ASSERT(x)                                \
29    do {                                                \
30        struct __staticAssertStruct__ {                 \
31            char __static_assert_failed__[2*(x) - 1];   \
32        };                                              \
33    } while (false)
34
35#endif  // DEBUG_H