blob: 69cc7e6764a7462e88c6413015e707bfb889501c [file] [log] [blame]
Dees_Troy2673cec2013-04-02 20:22:16 +00001#ifndef TWCOMMON_HPP
2#define TWCOMMON_HPP
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Ethan Yonker50381972014-02-11 11:44:06 -06008#ifndef BUILD_TWRPTAR_MAIN
Dees_Troy2673cec2013-04-02 20:22:16 +00009#include "gui/gui.h"
10#define LOGERR(...) gui_print("E:" __VA_ARGS__)
11#define LOGINFO(...) fprintf(stdout, "I:" __VA_ARGS__)
Ethan Yonker50381972014-02-11 11:44:06 -060012#else
13#define LOGERR(...) printf("E:" __VA_ARGS__)
14#define LOGINFO(...) printf("I:" __VA_ARGS__)
15#define gui_print(...) printf( __VA_ARGS__ )
16#endif
Dees_Troy2673cec2013-04-02 20:22:16 +000017
18#define STRINGIFY(x) #x
19#define EXPAND(x) STRINGIFY(x)
20
21#ifdef __cplusplus
22}
23#endif
24
25#endif // TWCOMMON_HPP