Bring back logs on macos.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4562 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-10-21 02:12:27 +00:00
parent 8e075e33d9
commit bb924d79d6

View File

@ -4,9 +4,15 @@
#include <android/log.h>
#define tf_printf(...) __android_log_print(ANDROID_LOG_INFO, "tildefriends", __VA_ARGS__)
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#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
#else
#include <stdio.h>
#define tf_printf printf
#endif