tildefriends/src/log.h

13 lines
456 B
C
Raw Normal View History

#pragma once
#if defined(__ANDROID__)
#include <android/log.h>
#define tf_printf(...) __android_log_print(ANDROID_LOG_INFO, "tildefriends", __VA_ARGS__)
#elif defined(__APPLE__)
#include <os/log.h>
#define tf_printf(...) do { char buffer ## __LINE__[2048]; snprintf(buffer ## __LINE__, sizeof(buffer ## __LINE__), __VA_ARGS__); os_log(OS_LOG_DEFAULT, "%{public}s", buffer ## __LINE__); } while (0)
#else
#include <stdio.h>
#define tf_printf printf
#endif