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