From 74145a7fef20947261db62b602a46800345241bb Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sat, 7 Nov 2009 12:21:48 +0100 Subject: [PATCH] Fix building with --disable-x11 --disable-lua --disable-ncurses --- src/conky.c | 12 ++++++++---- src/core.c | 2 ++ src/exec.c | 3 +++ src/net_stat.c | 1 + src/read_tcp.c | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/conky.c b/src/conky.c index 9345315..1b12d14 100644 --- a/src/conky.c +++ b/src/conky.c @@ -451,14 +451,15 @@ int check_contains(char *f, char *s) #define SECRIT_MULTILINE_CHAR '\x02' -#ifdef X11 - static inline int calc_text_width(const char *s) { size_t slen = strlen(s); +#ifdef X11 if ((output_methods & TO_X) == 0) { +#endif /* X11 */ return slen; +#ifdef X11 } #ifdef XFT if (use_xft) { @@ -477,8 +478,8 @@ static inline int calc_text_width(const char *s) { return XTextWidth(fonts[selected_font].font, s, slen); } -} #endif /* X11 */ +} /* formatted text to render on screen, generated in generate_text(), * drawn in draw_stuff() */ @@ -2301,7 +2302,10 @@ void generate_text_internal(char *p, int p_max_size, iconv_convert(&a, buff_in, p, p_max_size); #endif /* HAVE_ICONV */ if (obj->type != OBJ_text && obj->type != OBJ_execp && obj->type != OBJ_execpi - && obj->type != OBJ_lua && obj->type != OBJ_lua_parse) { +#ifdef HAVE_LUA + && obj->type != OBJ_lua && obj->type != OBJ_lua_parse +#endif /* HAVE_LUA */ + ) { substitute_newlines(p, a - 2); } p += a; diff --git a/src/core.c b/src/core.c index cb20336..58368e7 100644 --- a/src/core.c +++ b/src/core.c @@ -513,8 +513,10 @@ struct text_object *construct_text_object(const char *s, const char *arg, long obj->data.i = arg ? atoi(arg) : 1; END OBJ_ARG(goto, 0, "goto needs arguments") obj->data.i = atoi(arg); +#ifdef X11 END OBJ(tab, 0) scan_tab(obj, arg); +#endif /* X11 */ #ifdef __linux__ END OBJ_ARG(i2c, 0, "i2c needs arguments") parse_i2c_sensor(obj, arg); diff --git a/src/exec.c b/src/exec.c index e228e09..1d80c37 100644 --- a/src/exec.c +++ b/src/exec.c @@ -37,6 +37,7 @@ #include #include #include +#include struct execi_data { double last_update; @@ -236,6 +237,7 @@ void scan_execi_arg(struct text_object *obj, const char *arg) obj->data.opaque = ed; } +#ifdef X11 void scan_execgraph_arg(struct text_object *obj, const char *arg) { struct execi_data *ed; @@ -252,6 +254,7 @@ void scan_execgraph_arg(struct text_object *obj, const char *arg) ed->cmd = buf; obj->data.opaque = ed; } +#endif /* X11 */ void print_exec(struct text_object *obj, char *p, int p_max_size) { diff --git a/src/net_stat.c b/src/net_stat.c index 51cb4b6..34c7fe1 100644 --- a/src/net_stat.c +++ b/src/net_stat.c @@ -38,6 +38,7 @@ #include #include #include +#include /* network interface stuff */ diff --git a/src/read_tcp.c b/src/read_tcp.c index e33d947..e106043 100644 --- a/src/read_tcp.c +++ b/src/read_tcp.c @@ -34,6 +34,7 @@ #include #include #include +#include struct read_tcp_data { char *host; -- 1.7.9.5