42 lines
830 B
C
42 lines
830 B
C
#ifndef __TYPES__H__
|
|
#define __TYPES__H__
|
|
|
|
#include <stdio.h>
|
|
|
|
#define uint8_t unsigned char
|
|
#define uint16_t unsigned short
|
|
#define uint32_t unsigned int
|
|
#define uint64_t unsigned long long
|
|
#define int8_t char
|
|
#define int16_t short
|
|
#define int32_t int
|
|
#define int64_t long long
|
|
|
|
#define ptr_size_t unsigned long long
|
|
|
|
typedef int (*FUNCPTR) ( );
|
|
|
|
|
|
// 调试模式断言
|
|
#ifdef DEBUG
|
|
#define ASSERT(expr) \
|
|
do { \
|
|
if (expr) { \
|
|
printf("Assertion failed: %s, file %s, line %d\n", \
|
|
#expr, __FILE__, __LINE__); \
|
|
} \
|
|
} while (0)
|
|
#else
|
|
#define ASSERT(expr) ((void)0) // 发布模式禁用断言
|
|
#endif
|
|
|
|
#ifdef DEBUG
|
|
#define LOG(format, ...) \
|
|
printf(format, ##__VA_ARGS__)
|
|
#else
|
|
#define LOG(format, ...) ((void)0) // 发布模式禁用断言
|
|
#endif
|
|
|
|
|
|
#endif
|