Avoid inline osd calls in header file.

This commit is contained in:
couriersud 2015-01-14 01:54:46 +01:00
parent 11af4265a0
commit 53ee1c4138
2 changed files with 16 additions and 2 deletions

View File

@ -110,3 +110,16 @@ bool finder_base::report_missing(bool found, const char *objname, bool required)
osd_printf_verbose("Optional %s '%s' not found\n", objname, m_tag); osd_printf_verbose("Optional %s '%s' not found\n", objname, m_tag);
return !required; return !required;
} }
void finder_base::printf_warning(const char *format, ...)
{
va_list argptr;
char buffer[1024];
/* do the output */
va_start(argptr, format);
vsnprintf(buffer, 1024, format, argptr);
osd_printf_warning("%s", buffer);
va_end(argptr);
}

View File

@ -57,6 +57,8 @@ protected:
void *find_memshare(UINT8 width, size_t &bytes, bool required); void *find_memshare(UINT8 width, size_t &bytes, bool required);
bool report_missing(bool found, const char *objname, bool required); bool report_missing(bool found, const char *objname, bool required);
void printf_warning(const char *format, ...) ATTR_PRINTF(2,3);
// internal state // internal state
finder_base *m_next; finder_base *m_next;
device_t &m_base; device_t &m_base;
@ -113,8 +115,7 @@ public:
this->m_target = dynamic_cast<_DeviceClass *>(device); this->m_target = dynamic_cast<_DeviceClass *>(device);
if (device != NULL && this->m_target == NULL) if (device != NULL && this->m_target == NULL)
{ {
void osd_printf_warning(const char *format, ...) ATTR_PRINTF(1,2); this->printf_warning("Device '%s' found but is of incorrect type (actual type is %s)\n", this->m_tag, device->name());
osd_printf_warning("Device '%s' found but is of incorrect type (actual type is %s)\n", this->m_tag, device->name());
} }
return this->report_missing(this->m_target != NULL, "device", _Required); return this->report_missing(this->m_target != NULL, "device", _Required);
} }