新增根据git记录自动生成GIT_VERSION变量的代码

This commit is contained in:
dump2file
2019-02-24 13:44:18 +06:00
parent 5001fdee28
commit 94cacc5874
2 changed files with 31 additions and 1 deletions

View File

@@ -17,7 +17,29 @@ typedef struct log_handle_t
#define LOGMSG_MAX_LEN 4096
const int HANDLE_LOGGER_VERSION_20190218 = 1;
//const int HANDLE_LOGGER_VERSION_20190218 = 1;
#define GIT_VERSION_CATTER(v) __attribute__((__used__)) const char * GIT_VERSION_##v = NULL
#define GIT_VERSION_EXPEND(v) GIT_VERSION_CATTER(v)
#ifdef __cplusplus
extern "C"
{
#endif
/* VERSION TAG */
#ifdef GIT_VERSION
GIT_VERSION_EXPEND(GIT_VERSION);
#else
static __attribute__((__used__)) const char * GIT_VERSION_UNKNOWN = NULL;
#endif
#undef GIT_VERSION_CATTER
#undef GIT_VERSION_EXPEND
#ifdef __cplusplus
}
#endif
static unsigned char weekday_str[7][4] =
{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};