Skip to content

KDGpu spdlog fix #27

Description

@ssh4net

For better compatibility with different SPDlog builds, better adda check for SPD build type.
With c++20 no strong reasons to use fmt directly as same author integrated fmt as std::fmt

#if defined(SPDLOG_USE_STD_FORMAT)
template<>
struct KDGPU_EXPORT std::formatter<VkResult> : std::formatter<std::string> {
    template<typename FormatContext>
    auto format(VkResult const &result, FormatContext &ctx) const
    {
        return std::formatter<std::string>::format(getResultAsString(result), ctx);
    }
};
#else
template<>
struct KDGPU_EXPORT fmt::formatter<VkResult> : fmt::formatter<std::string> {
    template<typename FormatContext>
    auto format(VkResult const &result, FormatContext &ctx) const
    {
        return fmt::formatter<std::string>::format(getResultAsString(result), ctx);
    }
};
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions