Skip to content

Commit ec0273d

Browse files
committed
Merge remote-tracking branch 'origin/master' into build-flags-bench
2 parents 7c1a997 + 04adfc8 commit ec0273d

File tree

223 files changed

+17494
-2676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+17494
-2676
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
docs/
66
/tdlib/
77
vcpkg/
8+
.clang-tidy

CMake/TdSetUpCompiler.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function(td_set_up_compiler)
154154
# see http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579
155155
add_cxx_compiler_flag("-Wno-redundant-move")
156156
endif()
157-
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0))
157+
if (GCC)
158158
add_cxx_compiler_flag("-Wno-stringop-overflow") # some false positives
159159
endif()
160160
if (CLANG AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5))
@@ -164,6 +164,7 @@ function(td_set_up_compiler)
164164
if (GCC AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0))
165165
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104030
166166
add_cxx_compiler_flag("-Wbidi-chars=none")
167+
add_cxx_compiler_flag("-Wno-bidirectional")
167168
endif()
168169

169170
if (MINGW)

CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
22

3-
project(TDLib VERSION 1.8.46 LANGUAGES CXX C)
3+
project(TDLib VERSION 1.8.47 LANGUAGES CXX C)
44

55
if (NOT DEFINED CMAKE_MODULE_PATH)
66
set(CMAKE_MODULE_PATH "")
@@ -212,6 +212,9 @@ if (TD_BUILD_TESTING AND BUILD_TESTING)
212212
add_subdirectory(test)
213213
endif()
214214

215+
set(TDE2E_ENABLE_INSTALL ${TD_INSTALL_STATIC_LIBRARIES} CACHE BOOL "" FORCE)
216+
add_subdirectory(tde2e)
217+
215218
if (TD_BUILD_BENCHMARK AND (NOT CMAKE_CROSSCOMPILING))
216219
add_subdirectory(benchmark)
217220
endif()
@@ -349,6 +352,7 @@ set(TDLIB_SOURCE_PART1
349352
td/telegram/BusinessAwayMessage.cpp
350353
td/telegram/BusinessAwayMessageSchedule.cpp
351354
td/telegram/BusinessBotManageBar.cpp
355+
td/telegram/BusinessBotRights.cpp
352356
td/telegram/BusinessChatLink.cpp
353357
td/telegram/BusinessConnectedBot.cpp
354358
td/telegram/BusinessConnectionManager.cpp
@@ -397,6 +401,7 @@ set(TDLIB_SOURCE_PART1
397401
td/telegram/DialogParticipantManager.cpp
398402
td/telegram/DialogSource.cpp
399403
td/telegram/Dimensions.cpp
404+
td/telegram/DisallowedGiftsSettings.cpp
400405
td/telegram/Document.cpp
401406
td/telegram/DocumentsManager.cpp
402407
td/telegram/DownloadManager.cpp
@@ -576,6 +581,7 @@ set(TDLIB_SOURCE_PART2
576581
td/telegram/StarGiftAttribute.cpp
577582
td/telegram/StarGiftId.cpp
578583
td/telegram/StarGiftManager.cpp
584+
td/telegram/StarGiftSettings.cpp
579585
td/telegram/StarManager.cpp
580586
td/telegram/StarSubscription.cpp
581587
td/telegram/StarSubscriptionPricing.cpp
@@ -663,6 +669,7 @@ set(TDLIB_SOURCE_PART2
663669
td/telegram/BusinessAwayMessage.h
664670
td/telegram/BusinessAwayMessageSchedule.h
665671
td/telegram/BusinessBotManageBar.h
672+
td/telegram/BusinessBotRights.h
666673
td/telegram/BusinessChatLink.h
667674
td/telegram/BusinessConnectedBot.h
668675
td/telegram/BusinessConnectionId.h
@@ -724,6 +731,7 @@ set(TDLIB_SOURCE_PART2
724731
td/telegram/DialogParticipantManager.h
725732
td/telegram/DialogSource.h
726733
td/telegram/Dimensions.h
734+
td/telegram/DisallowedGiftsSettings.h
727735
td/telegram/Document.h
728736
td/telegram/DocumentsManager.h
729737
td/telegram/DownloadManager.h
@@ -949,6 +957,7 @@ set(TDLIB_SOURCE_PART2
949957
td/telegram/StarGiftAttribute.h
950958
td/telegram/StarGiftId.h
951959
td/telegram/StarGiftManager.h
960+
td/telegram/StarGiftSettings.h
952961
td/telegram/StarManager.h
953962
td/telegram/StarSubscription.h
954963
td/telegram/StarSubscriptionPricing.h
@@ -1023,6 +1032,7 @@ set(TDLIB_SOURCE_PART2
10231032
td/telegram/BotVerifierSettings.hpp
10241033
td/telegram/BusinessAwayMessage.hpp
10251034
td/telegram/BusinessAwayMessageSchedule.hpp
1035+
td/telegram/BusinessBotRights.hpp
10261036
td/telegram/BusinessConnectedBot.hpp
10271037
td/telegram/BusinessGreetingMessage.hpp
10281038
td/telegram/BusinessInfo.hpp
@@ -1034,6 +1044,7 @@ set(TDLIB_SOURCE_PART2
10341044
td/telegram/DialogInviteLink.hpp
10351045
td/telegram/DialogNotificationSettings.hpp
10361046
td/telegram/Dimensions.hpp
1047+
td/telegram/DisallowedGiftsSettings.hpp
10371048
td/telegram/Document.hpp
10381049
td/telegram/DocumentsManager.hpp
10391050
td/telegram/DraftMessage.hpp
@@ -1092,6 +1103,7 @@ set(TDLIB_SOURCE_PART2
10921103
td/telegram/StarGift.hpp
10931104
td/telegram/StarGiftAttribute.hpp
10941105
td/telegram/StarGiftId.hpp
1106+
td/telegram/StarGiftSettings.hpp
10951107
td/telegram/StarSubscriptionPricing.hpp
10961108
td/telegram/StickerMaskPosition.hpp
10971109
td/telegram/StickerPhotoSize.hpp
@@ -1189,11 +1201,11 @@ endif()
11891201
if (MSVC AND TD_ENABLE_LTO)
11901202
add_library(tdcore_part1 STATIC ${TDLIB_SOURCE_PART1})
11911203
target_include_directories(tdcore_part1 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
1192-
target_link_libraries(tdcore_part1 PUBLIC tdapi tdnet tddb tdactor tdutils PRIVATE tdmtproto)
1204+
target_link_libraries(tdcore_part1 PUBLIC tdapi tdnet tddb tdactor tde2e tdutils PRIVATE tdmtproto)
11931205

11941206
add_library(tdcore_part2 STATIC ${TDLIB_SOURCE_PART2})
11951207
target_include_directories(tdcore_part2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
1196-
target_link_libraries(tdcore_part2 PUBLIC tdapi tdnet tddb tdactor tdutils PRIVATE tdmtproto)
1208+
target_link_libraries(tdcore_part2 PUBLIC tdapi tdnet tddb tdactor tde2e tdutils PRIVATE tdmtproto)
11971209

11981210
add_library(tdcore INTERFACE)
11991211
target_link_libraries(tdcore INTERFACE tdcore_part1 tdcore_part2)
@@ -1202,7 +1214,7 @@ if (MSVC AND TD_ENABLE_LTO)
12021214
else()
12031215
add_library(tdcore STATIC ${TDLIB_SOURCE})
12041216
target_include_directories(tdcore PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
1205-
target_link_libraries(tdcore PUBLIC tdapi tdnet tddb tdactor tdutils PRIVATE tdmtproto)
1217+
target_link_libraries(tdcore PUBLIC tdapi tdnet tddb tdactor tde2e tdutils PRIVATE tdmtproto)
12061218

12071219
set(TD_CORE_PART_TARGETS)
12081220
endif()
@@ -1370,6 +1382,7 @@ include(GeneratePkgConfig)
13701382
if (TD_INSTALL_STATIC_LIBRARIES)
13711383
generate_pkgconfig(tdutils "Telegram Library - Utils")
13721384
generate_pkgconfig(tdactor "Telegram Library - Actor")
1385+
generate_pkgconfig(tde2e "Telegram Library - E2E")
13731386
generate_pkgconfig(tdnet "Telegram Library - Net")
13741387
generate_pkgconfig(tdsqlite "Telegram Library - SQLite")
13751388
generate_pkgconfig(tddb "Telegram Library - Database")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic)
103103

104104
Or you could install `TDLib` and then reference it in your CMakeLists.txt like this:
105105
```
106-
find_package(Td 1.8.46 REQUIRED)
106+
find_package(Td 1.8.47 REQUIRED)
107107
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
108108
```
109109
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/blob/master/example/cpp/CMakeLists.txt).

SplitSource.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ function ($matches) use ($needed_std_headers) {
316316
'BotVerification' => 'BotVerification',
317317
'BotVerifierSettings' => 'BotVerifierSettings',
318318
'BusinessAwayMessage' => 'BusinessAwayMessage',
319+
'BusinessBotRights' => 'BusinessBotRights',
319320
'BusinessChatLink' => 'BusinessChatLink',
320321
'BusinessConnectedBot' => 'BusinessConnectedBot',
321322
'BusinessConnectionId' => 'BusinessConnectionId',
@@ -351,6 +352,7 @@ function ($matches) use ($needed_std_headers) {
351352
'DialogParticipantFilter' => 'DialogParticipantFilter',
352353
'dialog_participant_manager[_(-](?![.]get[(][)])|DialogParticipantManager' => 'DialogParticipantManager',
353354
'DialogSource' => 'DialogSource',
355+
'DisallowedGiftsSettings' => 'DisallowedGiftsSettings',
354356
'documents_manager[_(-](?![.]get[(][)])|DocumentsManager' => 'DocumentsManager',
355357
'download_manager[_(-](?![.]get[(][)])|DownloadManager[^C]' => 'DownloadManager',
356358
'DownloadManagerCallback' => 'DownloadManagerCallback',
@@ -426,6 +428,7 @@ function ($matches) use ($needed_std_headers) {
426428
'StarGiftAttribute' => 'StarGiftAttribute',
427429
'StarGiftId' => 'StarGiftId',
428430
'star_gift_manager[_(-](?![.]get[(][)])|StarGiftManager' => 'StarGiftManager',
431+
'StarGiftSettings' => 'StarGiftSettings',
429432
'star_manager[_(-](?![.]get[(][)])|StarManager' => 'StarManager',
430433
'StarSubscription[^P]' => 'StarSubscription',
431434
'StarSubscriptionPricing' => 'StarSubscriptionPricing',

benchmark/bench_crypto.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ class HmacSha256ShortBench final : public td::Benchmark {
127127
void run(int n) final {
128128
unsigned char md[32];
129129
for (int i = 0; i < n; i++) {
130-
td::hmac_sha256(td::Slice(data, SHORT_DATA_SIZE), td::Slice(data, SHORT_DATA_SIZE), td::MutableSlice(md, 32));
130+
td::hmac_sha256(td::Slice(data, td::min(static_cast<std::size_t>(32), SHORT_DATA_SIZE)),
131+
td::Slice(data, SHORT_DATA_SIZE), td::MutableSlice(md, 32));
131132
}
132133
}
133134
};
@@ -145,9 +146,10 @@ class HmacSha512ShortBench final : public td::Benchmark {
145146
}
146147

147148
void run(int n) final {
148-
unsigned char md[32];
149+
unsigned char md[64];
149150
for (int i = 0; i < n; i++) {
150-
td::hmac_sha256(td::Slice(data, SHORT_DATA_SIZE), td::Slice(data, SHORT_DATA_SIZE), td::MutableSlice(md, 32));
151+
td::hmac_sha512(td::Slice(data, td::min(static_cast<std::size_t>(64), SHORT_DATA_SIZE)),
152+
td::Slice(data, SHORT_DATA_SIZE), td::MutableSlice(md, 64));
151153
}
152154
}
153155
};

example/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
22

33
project(TdExample VERSION 1.0 LANGUAGES CXX)
44

5-
find_package(Td 1.8.46 REQUIRED)
5+
find_package(Td 1.8.47 REQUIRED)
66

77
add_executable(tdjson_example tdjson_example.cpp)
88
target_link_libraries(tdjson_example PRIVATE Td::TdJson)

example/ios/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ do
5555
fi
5656

5757
echo "iOS platform = ${ios_platform}"
58-
other_options="-DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake"
58+
other_options="-DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake -DCMAKE_MAKE_PROGRAM=make"
5959
fi
6060

6161
set_cmake_options $platform

0 commit comments

Comments
 (0)