1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-29 22:11:31 +00:00

Merge branch 'clang19' into 'master'

Clang 19 build fix (!4549 without sol update)

See merge request OpenMW/openmw!4585
This commit is contained in:
psi29a 2025-03-14 14:47:20 +00:00
commit 2ca1850ea9
4 changed files with 7 additions and 3 deletions

View file

@ -52,7 +52,7 @@ namespace
return std::find_if(input.begin(), input.end(), [](unsigned char v) { return v == 0 || v >= 128; });
}
std::basic_string_view<signed char> getTranslationArray(FromType sourceEncoding)
std::span<const signed char> getTranslationArray(FromType sourceEncoding)
{
switch (sourceEncoding)
{

View file

@ -2,6 +2,7 @@
#define COMPONENTS_TOUTF8_H
#include <cstring>
#include <span>
#include <string>
#include <string_view>
#include <utility>
@ -50,7 +51,7 @@ namespace ToUTF8
inline void copyFromArrayLegacyEnc(
std::string_view::iterator& chp, std::string_view::iterator end, char*& out) const;
const std::basic_string_view<signed char> mTranslationArray;
const std::span<const signed char> mTranslationArray;
};
class Utf8Encoder

View file

@ -1,3 +1,5 @@
The code in this directory is copied from https://github.com/ThePhD/sol2.git (64096348465b980e2f1d0e5ba9cbeea8782e8f27)
Additional changes include cherry-picking upstream commit d805d027e0a0a7222e936926139f06e23828ce9f to fix compilation under Clang 19.
License: MIT

View file

@ -2191,7 +2191,8 @@ namespace sol {
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
*this = nullopt;
this->construct(std::forward<Args>(args)...);
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
return **this;
}
/// Swaps this optional with the other.