fix use of curses on windows.

workaround for curses defining its own boolean type.
This commit is contained in:
Enno Rehling 2013-12-28 22:58:39 -08:00
parent 78b007ff52
commit a2d6881f61
5 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,9 @@
#include <platform.h>
#include <kernel/types.h>
#undef bool
#include <curses.h>
#include <util/bool.h>
#include "bind_gmtool.h"
#include "../gmtool.h"

View File

@ -3,7 +3,6 @@
#include "items.h"
#include "study.h"
#include "curses.h"
#include <kernel/curse.h>
#include <kernel/building.h>

View File

@ -10,7 +10,10 @@
/* wenn platform.h nicht vor curses included wird, kompiliert es unter windows nicht */
#include <platform.h>
#undef bool
#include <curses.h>
#include <util/bool.h>
#include <kernel/config.h>
#include "gmtool.h"
@ -93,9 +96,9 @@ static void init_curses(void)
/* looks crap on putty with TERM=linux */
if (can_change_color()) {
init_color(COLOR_YELLOW, 1000, 1000, 0);
init_color(COLOR_CYAN, 0, 1000, 1000);
}
#endif
for (fg = 0; fg != 8; ++fg) {
for (bg = 0; bg != 2; ++bg) {
init_pair(fg + 8 * bg, fg, bg ? hcol : bcol);
@ -201,14 +204,14 @@ static int tagged_region(selection * s, int nx, int ny)
return 0;
}
static int mr_tile(const map_region * mr, int highlight)
static chtype mr_tile(const map_region * mr, int highlight)
{
int hl = 8 * highlight;
if (mr != NULL && mr->r != NULL) {
const region *r = mr->r;
switch (r->terrain->_name[0]) {
case 'o':
return '.' | COLOR_PAIR(hl + COLOR_CYAN);
return '.' | COLOR_PAIR(hl + COLOR_CYAN) | A_BOLD;
case 'd':
return 'D' | COLOR_PAIR(hl + COLOR_YELLOW) | A_BOLD;
case 't':

View File

@ -10,9 +10,12 @@
/* wenn platform.h nicht vor curses included wird, kompiliert es unter windows nicht */
#include <platform.h>
#include <curses.h>
#include <kernel/config.h>
#undef bool
#include <curses.h>
#include <util/bool.h>
#include "listbox.h"
#include "gmtool_structs.h"

View File

@ -4,6 +4,7 @@ project (server C)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
ELSEIF(MSVC)
ELSE(CMAKE_COMPILER_IS_GNUCC)
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)