libspades
Ace of Spades library
Main Page
Related Pages
Topics
Data Structures
common
log.h
1
#ifndef LIBSPADES_LOG_H
2
#define LIBSPADES_LOG_H
3
#ifdef __cplusplus
4
extern
"C"
{
5
#endif
6
7
#ifdef _MSC_VER
8
#define __restrict__ __restrict
9
#elif !defined(__GNUC__)
10
#define __restrict__
11
#endif
12
13
#include "datatypes.h"
14
15
void
libspades_log(
const
char
*__restrict__ format, ...);
16
char
*libspades_print_packet(
const
uint8_t *data,
size_t
dataLength);
17
18
/* More or less assert with an error message. */
19
#define LIBSPADES_FORCE_ASSERT(condition, action, printf_args) \
20
do { \
21
if (!(condition)) { \
22
libspades_log printf_args; \
23
action; \
24
} \
25
} while (0)
26
27
/* If you do not trust the server to have correct behaviour, I would recommend enabling this. */
28
#ifndef NDEBUG
29
#define LIBSPADES_ASSERT(condition, action, printf_args) LIBSPADES_FORCE_ASSERT(condition, action, printf_args)
30
#else
31
#define LIBSPADES_ASSERT(condition, action, printf_args) ((void)0)
32
#endif
33
34
#ifdef __cplusplus
35
}
36
#endif
37
#endif
This documentation has been rid of all JavaScript for a better experience. Generated by
1.13.2