From 7bca1e0a61a6e560eabc6a5bc58f9d976806a74a Mon Sep 17 00:00:00 2001 From: zogodo <742782908@qq.com> Date: Wed, 11 Dec 2019 11:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E5=BC=95?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/web_log.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TC1/http_server/web_log.h b/TC1/http_server/web_log.h index b7eb5c7..66b5a04 100644 --- a/TC1/http_server/web_log.h +++ b/TC1/http_server/web_log.h @@ -1,6 +1,9 @@ +#ifndef WEB_LOG_H +#define WEB_LOG_H #define LOG_NUM 100 #define LOG_LEN 128 + typedef struct { int idx; @@ -13,9 +16,9 @@ extern char* LOG_TMP; void SetLogRecord(LogRecord* lr, char* log); char* GetLogRecord(int idx); - -#define web_log(format, ...) \ +#define web_log(format, ...) \ LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \ snprintf(LOG_TMP, LOG_LEN, format, ##__VA_ARGS__); \ SetLogRecord(&log_record, LOG_TMP); \ +#endif // !WEB_LOG_H