dynarmic/src/common/string_util.h
Lioncash 897b776250 string_util: Use C++ attribute specifier for format strings
This is also compatible with both clang and GCC
2016-08-23 19:38:48 +01:00

32 lines
663 B
C++

/* This file is part of the dynarmic project.
* Copyright (c) 2016 MerryMage
* This software may be used and distributed according to the terms of the GNU
* General Public License version 2 or any later version.
*/
#pragma once
#include <string>
namespace Dynarmic {
namespace Common {
#ifdef __MINGW32__
[[gnu::format(gnu_printf, 1, 2)]]
#elif !defined(_MSC_VER)
[[gnu::format(printf, 1, 2)]]
#endif
std::string StringFromFormat(
#ifdef _MSC_VER
_Printf_format_string_
#endif
const char* format, ...);
template <typename T>
constexpr char SignToChar(T value) {
return value >= 0 ? '+' : '-';
}
} // namespace Common
} // namespace Dynarmic