ia64/xen-unstable

changeset 13225:f0e9c518d0ff

[SOLARIS] Fix xentop build.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Fri Dec 29 16:17:53 2006 +0000 (2006-12-29)
parents 25723963a6b6
children 89d4e80cd1b7
files tools/xenstat/xentop/Makefile tools/xenstat/xentop/xentop.c
line diff
     1.1 --- a/tools/xenstat/xentop/Makefile	Fri Dec 29 14:25:03 2006 +0000
     1.2 +++ b/tools/xenstat/xentop/Makefile	Fri Dec 29 16:17:53 2006 +0000
     1.3 @@ -26,6 +26,7 @@ sbindir=$(prefix)/sbin
     1.4  CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT)
     1.5  LDFLAGS += -L$(XEN_LIBXENSTAT)
     1.6  LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS)
     1.7 +CFLAGS += -DHOST_$(XEN_OS)
     1.8  
     1.9  .PHONY: all
    1.10  all: xentop
     2.1 --- a/tools/xenstat/xentop/xentop.c	Fri Dec 29 14:25:03 2006 +0000
     2.2 +++ b/tools/xenstat/xentop/xentop.c	Fri Dec 29 16:17:53 2006 +0000
     2.3 @@ -49,6 +49,13 @@
     2.4  
     2.5  #define KEY_ESCAPE '\x1B'
     2.6  
     2.7 +#ifdef HOST_SunOS
     2.8 +/* Old curses library on Solaris takes non-const strings. */
     2.9 +#define curses_str_t char *
    2.10 +#else
    2.11 +#define curses_str_t const char *
    2.12 +#endif
    2.13 +
    2.14  /*
    2.15   * Function prototypes
    2.16   */
    2.17 @@ -269,7 +276,7 @@ static void print(const char *fmt, ...)
    2.18  	if (!batch) {
    2.19  		if((current_row() < lines()-1)) {
    2.20  			va_start(args, fmt);
    2.21 -			vwprintw(stdscr, fmt, args);
    2.22 +			vwprintw(stdscr, (curses_str_t)fmt, args);
    2.23  			va_end(args);
    2.24  		}
    2.25  	} else {
    2.26 @@ -283,7 +290,7 @@ static void print(const char *fmt, ...)
    2.27  static void attr_addstr(int attr, const char *str)
    2.28  {
    2.29  	attron(attr);
    2.30 -	addstr(str);
    2.31 +	addstr((curses_str_t)str);
    2.32  	attroff(attr);
    2.33  }
    2.34