mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
[i18n] fix build on macos
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
e8ace998ba
commit
d68c7f8ea7
|
@ -94,10 +94,10 @@ std::string tr (TValue&& arg, TArgs&&... args)
|
|||
{
|
||||
std::string tr_str = i2p::i18n::translate(std::forward<TValue>(arg));
|
||||
|
||||
size_t size = snprintf(NULL, 0, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
size_t size = std::snprintf(NULL, 0, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
size = size + 1;
|
||||
std::string str(size, 0);
|
||||
snprintf(str.data(), size, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
std::snprintf(str.data(), size, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
@ -126,10 +126,10 @@ std::string ntr (TValue&& arg, TValue2&& arg2, int& n, TArgs&&... args)
|
|||
{
|
||||
std::string tr_str = i2p::i18n::translate(std::forward<TValue>(arg), std::forward<TValue2>(arg2), std::forward<int>(n));
|
||||
|
||||
size_t size = snprintf(NULL, 0, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
size_t size = std::snprintf(NULL, 0, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
size = size + 1;
|
||||
std::string str(size, 0);
|
||||
snprintf(str.data(), size, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
std::snprintf(str.data(), size, tr_str.c_str(), std::forward<TArgs>(args)...);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue