diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-10-22 14:19:32 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-10-22 14:19:32 -0700 |
commit | 57bd18ef88e48c18abf156b2635675df56c4a67e (patch) | |
tree | 799051ed279430013833078b976ec1eb2d9c376b | |
parent | c03e43f9bc38133f88fb93078e634b105e4a0600 (diff) | |
download | ksyxbot-57bd18ef88e48c18abf156b2635675df56c4a67e.tar ksyxbot-57bd18ef88e48c18abf156b2635675df56c4a67e.tar.gz ksyxbot-57bd18ef88e48c18abf156b2635675df56c4a67e.tar.bz2 ksyxbot-57bd18ef88e48c18abf156b2635675df56c4a67e.zip |
Use version number as TDLib config version
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | config.h.in | 7 | ||||
-rw-r--r-- | tdutils.c | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index deede86..380cb42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(ksyxbot VERSION 1.0 LANGUAGES C CXX) set(CMAKE_C_STANDARD 99) +configure_file(config.h.in config.h) + IF (CMAKE_BUILD_TYPE MATCHES Debug) add_compile_definitions(TD_USE_ASAN) ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..ccae582 --- /dev/null +++ b/config.h.in @@ -0,0 +1,7 @@ +#ifndef BOT_CONFIG_H +#define BOT_CONFIG_H + +#define VER_MAJOR "@ksyxbot_VERSION_MAJOR@" +#define VER_MINOR "@ksyxbot_VERSION_MINOR@" + +#endif /* BOT_CONFIG_H */
\ No newline at end of file @@ -1,6 +1,7 @@ #include "tdutils.h" #include "botd.h" #include "log.h" +#include "config.h" #include <stdio.h> #include <td/telegram/td_c_client.h> @@ -252,7 +253,7 @@ static int handle_auth(const struct TdUpdateAuthorizationState *update) { "en", "Desktop", "0.0", - "Channel Helper Bot 1.0", + "ksyxbotd "VER_MAJOR"."VER_MINOR, false, true )), |