openMSX
openmsx.hh
Go to the documentation of this file.
1 #ifndef OPENMSX_HH
2 #define OPENMSX_HH
3 
4 #include "build-info.hh"
5 
6 // don't just always include this, saves about 1 minute build time!!
7 #ifdef DEBUG
8 #include <iostream>
9 #include <sstream>
10 #endif
11 
12 #if PLATFORM_ANDROID
13 #include <android/log.h>
14 #define ad_printf(...) __android_log_print(ANDROID_LOG_INFO, "openMSX", __VA_ARGS__)
15 #else
16 #define ad_printf(...)
17 #endif
18 
20 
25 namespace openmsx {
26 
28 typedef unsigned char nibble;
29 
31 typedef signed char signed_byte;
33 typedef unsigned char byte;
34 
36 typedef short signed_word;
38 typedef unsigned short word;
39 
40 #ifdef DEBUG
41 
42 #ifdef _WIN32
43 
44 void DebugPrint(const char* output);
45 
46 #define PRT_DEBUG(mes) \
47  do { \
48  std::ostringstream output; \
49  output << mes; \
50  std::cout << output << std::endl; \
51  ::openmsx::DebugPrint(output.str().c_str()); \
52  } while (0)
53 #elif PLATFORM_ANDROID
54 #define PRT_DEBUG(mes) \
55  do { \
56  std::ostringstream output; \
57  output << mes; \
58  std::cout << output << std::endl; \
59  __android_log_write(ANDROID_LOG_DEBUG, "openMSX", output.str().c_str()); \
60  } while (0)
61 #else
62 #define PRT_DEBUG(mes) \
63  do { \
64  std::cout << mes << std::endl; \
65  } while (0)
66 #endif
67 #else
68 
69 #define PRT_DEBUG(mes)
70 
71 #endif
72 
73 } // namespace openmsx
74 
75 #endif