Fix building with --disable-x11 --disable-lua --disable-ncurses
authorNikolas Garofil <garo@dunaldi.garofil.be>
Sat, 7 Nov 2009 11:21:48 +0000 (12:21 +0100)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Sat, 7 Nov 2009 11:21:48 +0000 (12:21 +0100)
src/conky.c
src/core.c
src/exec.c
src/net_stat.c
src/read_tcp.c

index 9345315..1b12d14 100644 (file)
@@ -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;
index cb20336..58368e7 100644 (file)
@@ -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);
index e228e09..1d80c37 100644 (file)
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 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)
 {
index 51cb4b6..34c7fe1 100644 (file)
@@ -38,6 +38,7 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/ioctl.h>
+#include <unistd.h>
 
 /* network interface stuff */
 
index e33d947..e106043 100644 (file)
@@ -34,6 +34,7 @@
 #include <netdb.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 struct read_tcp_data {
        char *host;