mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 02:52:30 +02:00
VideoCommon: teach gcc to type-check the arguments fed to Write()
Note that the "this" implicit argument counts as 1, which is why all the printf arguments are shifted over one.
This commit is contained in:
parent
5380fd9dba
commit
2fc2b82963
@ -32,8 +32,11 @@ public:
|
||||
* Can be used like printf.
|
||||
* @note In the ShaderCode implementation, this does indeed write the parameter string to an internal buffer. However, you're free to do whatever you like with the parameter.
|
||||
*/
|
||||
template<typename... Args>
|
||||
void Write(const char*, Args...) {}
|
||||
void Write(const char*, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 2, 3)))
|
||||
#endif
|
||||
{}
|
||||
|
||||
/*
|
||||
* Returns a read pointer to the internal buffer.
|
||||
@ -116,6 +119,9 @@ public:
|
||||
}
|
||||
|
||||
void Write(const char* fmt, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 2, 3)))
|
||||
#endif
|
||||
{
|
||||
va_list arglist;
|
||||
va_start(arglist, fmt);
|
||||
|
Loading…
Reference in New Issue
Block a user