blob: be243236fbdb69f44d9a1b18666912a2635f116e [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"
Ethan Yonkerbf2cb1c2014-07-02 10:15:54 -050010#define LOGERR(...) gui_print_color("error", "E:" __VA_ARGS__)
Dees_Troy2673cec2013-04-02 20:22:16 +000011#define LOGINFO(...) fprintf(stdout, "I:" __VA_ARGS__)
Ethan Yonker50381972014-02-11 11:44:06 -060012#else
Ethan Yonker068c7682015-09-25 11:25:20 -050013#include <stdio.h>
Ethan Yonker50381972014-02-11 11:44:06 -060014#define LOGERR(...) printf("E:" __VA_ARGS__)
15#define LOGINFO(...) printf("I:" __VA_ARGS__)
16#define gui_print(...) printf( __VA_ARGS__ )
17#endif
Dees_Troy2673cec2013-04-02 20:22:16 +000018
19#define STRINGIFY(x) #x
20#define EXPAND(x) STRINGIFY(x)
21
22#ifdef __cplusplus
23}
24#endif
25
26#endif // TWCOMMON_HPP