Mercurial > hg > nnchat
changeset 468:607bd4491e79
Fix win32 build.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 26 May 2012 07:07:03 +0300 |
parents | 4b2f94b1a3c1 |
children | e305258bed25 |
files | main.c ui.h util.c |
diffstat | 3 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Sat May 26 06:58:49 2012 +0300 +++ b/main.c Sat May 26 07:07:03 2012 +0300 @@ -8,11 +8,9 @@ #include "ui.h" #include "th_args.h" #include "th_config.h" +#include <time.h> #include <errno.h> -#include <time.h> #ifdef __WIN32 -// Undefine because both windows.h and curses.h #define it -#undef MOUSE_MOVED #include <shlwapi.h> #else #include <sys/wait.h> @@ -1684,10 +1682,10 @@ else if (c >= 0x198 && c <= 0x1a0) { // Chat window switching via Meta/Esc-[1..9] - int win = c - 0x198; - if (win < SET_MAX_WINDOWS && chatWindows[win] != NULL) + nn_window_t *win = nnwin_get(c - 0x198); + if (win != NULL) { - currWin = chatWindows[win]; + currWin = win; update = updateMain = TRUE; } c = ERR; @@ -1964,7 +1962,7 @@ { char *tmp; wclear(editWin); - tmp = promptRequester(editWin, "Press enter to quit.\n", FALSE); + tmp = nnwin_prompt_requester(editWin, "Press enter to quit.\n", FALSE); th_free(tmp); } #endif
--- a/ui.h Sat May 26 06:58:49 2012 +0300 +++ b/ui.h Sat May 26 07:07:03 2012 +0300 @@ -6,14 +6,17 @@ #ifndef LIBNNUI_H #define LIBNNUI_H -#include "th_types.h" -#include "th_string.h" - +#ifdef __WIN32 +// Undefine because both windows.h and curses.h #define it +#undef MOUSE_MOVED +#endif #ifdef HAVE_NCURSES_H #include <ncurses.h> #else #include <curses.h> #endif +#include "th_types.h" +#include "th_string.h" #define SET_MAX_WINDOWS (32)