diff options
Diffstat (limited to 'tools/xenstat/xentop')
-rw-r--r-- | tools/xenstat/xentop/Makefile | 1 | ||||
-rw-r--r-- | tools/xenstat/xentop/xentop.c | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile index 2248bfb3c3..5f85d732e6 100644 --- a/tools/xenstat/xentop/Makefile +++ b/tools/xenstat/xentop/Makefile @@ -26,6 +26,7 @@ sbindir=$(prefix)/sbin CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT) LDFLAGS += -L$(XEN_LIBXENSTAT) LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS) +CFLAGS += -DHOST_$(XEN_OS) .PHONY: all all: xentop diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c index a2ea23a735..4b610c3668 100644 --- a/tools/xenstat/xentop/xentop.c +++ b/tools/xenstat/xentop/xentop.c @@ -49,6 +49,13 @@ #define KEY_ESCAPE '\x1B' +#ifdef HOST_SunOS +/* Old curses library on Solaris takes non-const strings. */ +#define curses_str_t char * +#else +#define curses_str_t const char * +#endif + /* * Function prototypes */ @@ -269,7 +276,7 @@ static void print(const char *fmt, ...) if (!batch) { if((current_row() < lines()-1)) { va_start(args, fmt); - vwprintw(stdscr, fmt, args); + vwprintw(stdscr, (curses_str_t)fmt, args); va_end(args); } } else { @@ -283,7 +290,7 @@ static void print(const char *fmt, ...) static void attr_addstr(int attr, const char *str) { attron(attr); - addstr(str); + addstr((curses_str_t)str); attroff(attr); } |