Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ft2font.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#ifndef MPL_FT2FONT_H
#define MPL_FT2FONT_H

#include <filesystem>
#include <set>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -42,11 +41,12 @@ inline char const* ft_error_string(FT_Error error) {

// No more than 16 hex digits + "0x" + null byte for a 64-bit int error.
#define THROW_FT_ERROR(name, err) { \
std::string path{__FILE__}; \
char buf[20] = {0}; \
sprintf(buf, "%#04x", err); \
snprintf(buf, sizeof buf, "%#04x", err); \
throw std::runtime_error{ \
name " (" \
+ std::filesystem::path(__FILE__).filename().string() \
+ path.substr(path.find_last_of("/\\") + 1) \
+ " line " + std::to_string(__LINE__) + ") failed with error " \
+ std::string{buf} + ": " + std::string{ft_error_string(err)}}; \
} (void)0
Expand Down
Loading