Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 1 | #ifndef TWCOMMON_HPP |
| 2 | #define TWCOMMON_HPP |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Ethan Yonker | 5038197 | 2014-02-11 11:44:06 -0600 | [diff] [blame] | 8 | #ifndef BUILD_TWRPTAR_MAIN |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 9 | #include "gui/gui.h" |
Ethan Yonker | bf2cb1c | 2014-07-02 10:15:54 -0500 | [diff] [blame] | 10 | #define LOGERR(...) gui_print_color("error", "E:" __VA_ARGS__) |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 11 | #define LOGINFO(...) fprintf(stdout, "I:" __VA_ARGS__) |
Ethan Yonker | 5038197 | 2014-02-11 11:44:06 -0600 | [diff] [blame] | 12 | #else |
Ethan Yonker | 068c768 | 2015-09-25 11:25:20 -0500 | [diff] [blame] | 13 | #include <stdio.h> |
Ethan Yonker | 5038197 | 2014-02-11 11:44:06 -0600 | [diff] [blame] | 14 | #define LOGERR(...) printf("E:" __VA_ARGS__) |
| 15 | #define LOGINFO(...) printf("I:" __VA_ARGS__) |
| 16 | #define gui_print(...) printf( __VA_ARGS__ ) |
| 17 | #endif |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 18 | |
| 19 | #define STRINGIFY(x) #x |
| 20 | #define EXPAND(x) STRINGIFY(x) |
| 21 | |
| 22 | #ifdef __cplusplus |
| 23 | } |
| 24 | #endif |
| 25 | |
| 26 | #endif // TWCOMMON_HPP |