Fix MacOS clang build of similar/2d/font.cpp
clang-14 on OSX, but not clang-14 on x86_64-pc-linux-gnu, fails class template argument deduction when given: ``` char *c1 = initializer(); const char *c2 = c1 + 1; std::span{c1, c2}; ``` clang correctly refuses to match this to `std::span(pointer, pointer)`, but fails to find the constructor `std::span(iterator, sentinel)`. Work around this by changing the type of the sentinel from `const uint8_t *` to `color_palette_index *` (an alias of `uint8_t *`). Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/664>
This commit is contained in:
parent
f5258f95b1
commit
fc4157f56f
|
@ -902,7 +902,7 @@ static void grs_font_read(grs_font *gf, PHYSFS_File *fp)
|
|||
|
||||
static std::unique_ptr<grs_font> gr_internal_init_font(const char *fontname)
|
||||
{
|
||||
const uint8_t *ptr;
|
||||
color_palette_index *ptr;
|
||||
color_palette_index *ft_data;
|
||||
struct {
|
||||
std::array<char, 4> magic;
|
||||
|
@ -979,7 +979,7 @@ static std::unique_ptr<grs_font> gr_internal_init_font(const char *fontname)
|
|||
font->ft_data = ft_data = font_data;
|
||||
font->ft_widths = NULL;
|
||||
|
||||
ptr = font->ft_data + (nchars * font->ft_w * font->ft_h);
|
||||
ptr = ft_data + (nchars * font->ft_w * font->ft_h);
|
||||
}
|
||||
|
||||
if (font->ft_flags & FT_KERNED)
|
||||
|
|
Loading…
Reference in a new issue