diff options
| author | Lu Qiuwen <[email protected]> | 2018-10-11 20:08:22 +0800 |
|---|---|---|
| committer | Lu Qiuwen <[email protected]> | 2018-10-11 20:08:22 +0800 |
| commit | 70fbff5b7decf040e172a1761568a72059702b25 (patch) | |
| tree | 073d62bc82151982796b01b6a4164c1a52e9b366 /platform/src/proxy.cpp | |
| parent | 72b931b02a484668a4135903bef7c8e01eee9aef (diff) | |
增加自动版本标记脚本,从Tag中提取版本号,自动生成nm | grep VERSION方式查看的版本号。
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 8847b90..c6b778c 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -45,6 +45,25 @@ struct tfe_proxy * g_default_proxy = NULL; thread_local unsigned int __currect_thread_id = 0; thread_local void * __currect_default_logger = NULL; +#define TFE_VAR_VERSION_CATTER(v) static __attribute__((__used__)) const char * TFE_VERSION_version_##v = NULL +#define TFE_VAR_VERSION_EXPEND(v) TFE_VAR_VERSION_CATTER(v) + +/* VERSION TAG */ +#ifdef TFE_VAR_VERSION +TFE_VAR_VERSION_EXPEND(TFE_VAR_VERSION); +#else +static __attribute__((__used__)) const char * TFE_VERSION_version_UNKNOWN = NULL; +#endif +#undef TFE_VAR_VERSION_CATTER +#undef TFE_VAR_VERSION_EXPEND + +/* VERSION STRING */ +#ifdef TFE_GIT_VERSION +static __attribute__((__used__)) const char * tfe_version = TFE_GIT_VERSION; +#else +static __attribute__((__used__)) const char * tfe_version = "Unknown"; +#endif + struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx) { unsigned int min_thread_id = 0; |
