win32/HResult: use libfmt
This commit is contained in:
parent
c8f54b3509
commit
b773ef3f0f
@ -8,8 +8,9 @@
|
|||||||
|
|
||||||
#include "HResult.hxx"
|
#include "HResult.hxx"
|
||||||
|
|
||||||
|
#include <fmt/core.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#include <combaseapi.h> // needed by audiopolicy.h if COM_NO_WINDOWS_H is defined
|
#include <combaseapi.h> // needed by audiopolicy.h if COM_NO_WINDOWS_H is defined
|
||||||
#include <audiopolicy.h>
|
#include <audiopolicy.h>
|
||||||
@ -69,7 +70,5 @@ HResultCategory::message(int Errcode) const
|
|||||||
if (!msg.empty())
|
if (!msg.empty())
|
||||||
return std::string(msg);
|
return std::string(msg);
|
||||||
|
|
||||||
int size = snprintf(buffer, sizeof(buffer), "0x%1x", Errcode);
|
return fmt::format("{:#x}", Errcode);
|
||||||
assert(2 <= size && size <= 10);
|
|
||||||
return std::string(buffer, size);
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@ win32 = static_library(
|
|||||||
'PropVariant.cxx',
|
'PropVariant.cxx',
|
||||||
'WinEvent.cxx',
|
'WinEvent.cxx',
|
||||||
include_directories: inc,
|
include_directories: inc,
|
||||||
|
dependencies: [
|
||||||
|
fmt_dep,
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
win32_dep = declare_dependency(
|
win32_dep = declare_dependency(
|
||||||
|
Loading…
Reference in New Issue
Block a user