mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
fix compile on 4.9.x (nw)
This commit is contained in:
parent
855136bfc3
commit
34cac8befd
@ -199,8 +199,9 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &n
|
|||||||
unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
|
unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
|
||||||
unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 };
|
unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 };
|
||||||
unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 };
|
unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 };
|
||||||
unsigned char buffer[std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) })];
|
auto buffer_size = std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) });
|
||||||
auto const bytes_read = file.read(buffer, sizeof(buffer));
|
unsigned char buffer[buffer_size];
|
||||||
|
auto const bytes_read = file.read(buffer, buffer_size);
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (((bytes_read >= sizeof(ttf_magic)) && !std::memcmp(buffer, ttf_magic, sizeof(ttf_magic))) ||
|
if (((bytes_read >= sizeof(ttf_magic)) && !std::memcmp(buffer, ttf_magic, sizeof(ttf_magic))) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user