(runloop_msg) Add rarch_main_msg_queue_pushf()

This commit is contained in:
Higor Eurípedes 2015-11-28 16:07:53 -03:00
parent 6a99893705
commit 6dfa580dfa
3 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,9 @@
#ifndef snprintf
#define snprintf _snprintf
#endif
#ifndef vsnprintf
#define vsnprintf _vsnprintf
#endif
#endif
#undef UNICODE /* Do not bother with UNICODE at this time. */

View File

@ -344,6 +344,9 @@ int rarch_main_iterate(unsigned *sleep_ms);
void rarch_main_msg_queue_push(const char *msg, unsigned prio,
unsigned duration, bool flush);
void rarch_main_msg_queue_pushf(unsigned prio, unsigned duration,
bool flush, const char *fmt, ...);
void rarch_main_msg_queue_push_new(uint32_t hash, unsigned prio,
unsigned duration, bool flush);

View File

@ -89,6 +89,17 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio, unsigned duration
}
}
void rarch_main_msg_queue_pushf(unsigned prio, unsigned duration,
bool flush, const char *fmt, ...)
{
char buf[1024];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
rarch_main_msg_queue_push(buf, prio, duration, flush);
}
void rarch_main_msg_queue_free(void)
{
if (!g_msg_queue)