mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
防止重复引用
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
|
#ifndef WEB_LOG_H
|
||||||
|
#define WEB_LOG_H
|
||||||
|
|
||||||
#define LOG_NUM 100
|
#define LOG_NUM 100
|
||||||
#define LOG_LEN 128
|
#define LOG_LEN 128
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
@@ -13,9 +16,9 @@ extern char* LOG_TMP;
|
|||||||
void SetLogRecord(LogRecord* lr, char* log);
|
void SetLogRecord(LogRecord* lr, char* log);
|
||||||
char* GetLogRecord(int idx);
|
char* GetLogRecord(int idx);
|
||||||
|
|
||||||
|
#define web_log(format, ...) \
|
||||||
#define web_log(format, ...) \
|
|
||||||
LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \
|
LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \
|
||||||
snprintf(LOG_TMP, LOG_LEN, format, ##__VA_ARGS__); \
|
snprintf(LOG_TMP, LOG_LEN, format, ##__VA_ARGS__); \
|
||||||
SetLogRecord(&log_record, LOG_TMP); \
|
SetLogRecord(&log_record, LOG_TMP); \
|
||||||
|
|
||||||
|
#endif // !WEB_LOG_H
|
||||||
|
|||||||
Reference in New Issue
Block a user