From 0724a9efa230d05fbf355087450a978890ac26d7 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 28 May 2015 18:28:34 +0300 Subject: [PATCH] printf_alike removed --- Utilities/GNU.h | 6 ------ Utilities/Log.h | 2 +- Utilities/StrFmt.h | 4 ++-- rpcs3/Emu/SysCalls/LogBase.h | 14 +++++++------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Utilities/GNU.h b/Utilities/GNU.h index 8bf07f7b53..d592131297 100644 --- a/Utilities/GNU.h +++ b/Utilities/GNU.h @@ -20,12 +20,6 @@ #define safe_buffers #endif -#if defined(_MSC_VER) -#define printf_alike(x, y) -#else -#define printf_alike(x, y) __attribute__((format(printf, x, y))) -#endif - #if defined(_MSC_VER) #define force_inline __forceinline #else diff --git a/Utilities/Log.h b/Utilities/Log.h index 32c3f1679e..c5df9a7217 100644 --- a/Utilities/Log.h +++ b/Utilities/Log.h @@ -129,7 +129,7 @@ static struct { inline operator Log::LogType() { return Log::LogType::TTY; } } T void log_message(Log::LogType type, Log::LogSeverity sev, const char* text); void log_message(Log::LogType type, Log::LogSeverity sev, std::string text); -template never_inline printf_alike(3, 4) void log_message(Log::LogType type, Log::LogSeverity sev, const char* fmt, Args... args) +template never_inline void log_message(Log::LogType type, Log::LogSeverity sev, const char* fmt, Args... args) { log_message(type, sev, fmt::Format(fmt, fmt::do_unveil(args)...)); } diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 8db5552e9f..e99e02ed87 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -95,7 +95,7 @@ namespace fmt T by_value(T x) { return x; } //wrapper to deal with advance sprintf formating options with automatic length finding - template printf_alike(1, 2) std::string Format(const char* fmt, Args... parameters) + template std::string Format(const char* fmt, Args... parameters) { size_t length = 256; std::string str; @@ -265,7 +265,7 @@ namespace fmt vm::psv::ref (fmt::unveil) (vm_ref.h) */ - template force_inline safe_buffers printf_alike(1, 2) std::string format(const char* fmt, Args... args) + template force_inline safe_buffers std::string format(const char* fmt, Args... args) { return Format(fmt, do_unveil(args)...); } diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h index a64133efb8..4acdc0d11b 100644 --- a/rpcs3/Emu/SysCalls/LogBase.h +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -35,12 +35,12 @@ public: virtual const std::string& GetName() const = 0; - template force_inline printf_alike(2, 3) void Notice(const char* fmt, Args... args) const + template force_inline void Notice(const char* fmt, Args... args) const { LogPrepare(LogNotice, fmt, fmt::do_unveil(args)...); } - template force_inline printf_alike(2, 3) void Log(const char* fmt, Args... args) const + template force_inline void Log(const char* fmt, Args... args) const { if (CheckLogging()) { @@ -48,27 +48,27 @@ public: } } - template force_inline printf_alike(2, 3) void Success(const char* fmt, Args... args) const + template force_inline void Success(const char* fmt, Args... args) const { LogPrepare(LogSuccess, fmt, fmt::do_unveil(args)...); } - template force_inline printf_alike(2, 3) void Warning(const char* fmt, Args... args) const + template force_inline void Warning(const char* fmt, Args... args) const { LogPrepare(LogWarning, fmt, fmt::do_unveil(args)...); } - template force_inline printf_alike(2, 3) void Error(const char* fmt, Args... args) const + template force_inline void Error(const char* fmt, Args... args) const { LogPrepare(LogError, fmt, fmt::do_unveil(args)...); } - template force_inline printf_alike(2, 3) void Fatal(const char* fmt, Args... args) const + template force_inline void Fatal(const char* fmt, Args... args) const { LogPrepare(LogFatal, fmt, fmt::do_unveil(args)...); } - template force_inline printf_alike(2, 3) void Todo(const char* fmt, Args... args) const + template force_inline void Todo(const char* fmt, Args... args) const { LogPrepare(LogTodo, fmt, fmt::do_unveil(args)...); }