Gainput  v1.0.0
GainputLog.h
1 
2 #ifndef GAINPUT_LOG_H_
3 #define GAINPUT_LOG_H_
4 
5 #include <gainput/gainput.h>
6 
7 #if defined(GAINPUT_PLATFORM_LINUX)
8 
9 #if defined(GAINPUT_DEBUG) || defined(GAINPUT_DEV)
10  #include <stdio.h>
11  #define GAINPUT_LOG(...) printf(__VA_ARGS__);
12 #endif
13 
14 #elif defined(GAINPUT_PLATFORM_WIN)
15 
16 #if defined(GAINPUT_DEBUG) || defined(GAINPUT_DEV)
17  #include <stdio.h>
18  #include <Windows.h>
19  #define GAINPUT_LOG(...) { char buf[1024]; sprintf(buf, __VA_ARGS__); OutputDebugStringA(buf); }
20 #endif
21 
22 #elif defined(GAINPUT_PLATFORM_ANDROID)
23 
24 #if defined(GAINPUT_DEBUG) || defined(GAINPUT_DEV)
25  #include <android/log.h>
26  #define GAINPUT_LOG(...) ((void)__android_log_print(ANDROID_LOG_INFO, "gainput", __VA_ARGS__))
27 #endif
28 
29 #elif defined(GAINPUT_PLATFORM_IOS) || defined(GAINPUT_PLATFORM_MAC) || defined(GAINPUT_PLATFORM_TVOS)
30  #include <stdio.h>
31  #define GAINPUT_LOG(...) printf(__VA_ARGS__);
32 #endif
33 
34 #ifndef GAINPUT_LOG
35 #define GAINPUT_LOG(...)
36 #endif
37 
38 #endif
39