9e957d466f
Server listens correctly with threads and stdin reader thread. Client does nothing currently gutting UDP_Write for a UDPbase class introduced in this commit.
33 lines
562 B
C
33 lines
562 B
C
#pragma once
|
|
|
|
#ifdef DEBUG
|
|
|
|
#include <SDL_log.h>
|
|
#include <stdarg.h>
|
|
|
|
#define DEBUG_LOG(...) debug_log (__FILE__, __LINE__, __func__, __VA_ARGS__)
|
|
|
|
static void
|
|
debug_log (
|
|
const char* filename,
|
|
const int lineno,
|
|
const char* func,
|
|
const char* fmt, ...)
|
|
{
|
|
va_list ap;
|
|
char buf[8192];
|
|
|
|
SDL_memset (buf, 0, sizeof buf);
|
|
va_start (ap, fmt);
|
|
vsnprintf (buf, (sizeof buf) - 1, fmt, ap);
|
|
va_end (ap);
|
|
|
|
SDL_LogMessage (SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG,
|
|
"%s:%d: %s(): %s", filename, lineno, func, buf);
|
|
}
|
|
|
|
|
|
#else
|
|
#define DEBUG_LOG(...)
|
|
#endif
|