blob: 089542859b5406ad264312e8715e5accd0d740bc [file] [log] [blame]
Matt Mowere04eee72016-12-31 00:38:57 -06001/*
2 Copyright 2017 TeamWin
3 This file is part of TWRP/TeamWin Recovery Project.
4
5 TWRP is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 TWRP is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with TWRP. If not, see <http://www.gnu.org/licenses/>.
17*/
18
Dees_Troy2673cec2013-04-02 20:22:16 +000019#ifndef TWCOMMON_HPP
20#define TWCOMMON_HPP
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
Ethan Yonker50381972014-02-11 11:44:06 -060026#ifndef BUILD_TWRPTAR_MAIN
Dees_Troy2673cec2013-04-02 20:22:16 +000027#include "gui/gui.h"
Ethan Yonkerbf2cb1c2014-07-02 10:15:54 -050028#define LOGERR(...) gui_print_color("error", "E:" __VA_ARGS__)
Dees_Troy2673cec2013-04-02 20:22:16 +000029#define LOGINFO(...) fprintf(stdout, "I:" __VA_ARGS__)
Ethan Yonker50381972014-02-11 11:44:06 -060030#else
Ethan Yonker068c7682015-09-25 11:25:20 -050031#include <stdio.h>
Ethan Yonker50381972014-02-11 11:44:06 -060032#define LOGERR(...) printf("E:" __VA_ARGS__)
33#define LOGINFO(...) printf("I:" __VA_ARGS__)
34#define gui_print(...) printf( __VA_ARGS__ )
35#endif
Dees_Troy2673cec2013-04-02 20:22:16 +000036
37#define STRINGIFY(x) #x
38#define EXPAND(x) STRINGIFY(x)
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif // TWCOMMON_HPP