From 14e3000983cf98d12dab9560f7ee0e3cbcc5ddfb Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 20 Jun 2007 19:57:53 +0000 Subject: Fixed broken compile on DOS and Windows. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1611 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/AppHdr.h | 4 +++- crawl-ref/source/beam.cc | 8 ++++---- crawl-ref/source/decks.cc | 2 +- crawl-ref/source/libdos.cc | 6 ++++++ crawl-ref/source/libdos.h | 7 ++----- crawl-ref/source/libw32c.cc | 1 + 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index fa6ad69293..a42d8141a9 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -180,11 +180,13 @@ #define vsnprintf(buf, size, format, args) vsprintf(buf, format, args) #endif + #include + #elif defined(WIN32CONSOLE) #include "libw32c.h" #define EOL "\n" #define CHARACTER_SET A_ALTCHARSET - #define getstr(X,Y) getConsoleString(X,Y) + #define getstr(X,Y) get_console_string(X,Y) // NT and better are happy with /; I'm not sure how 9x reacts. #define FILE_SEPARATOR '/' diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 5027becf19..e4f962eaef 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1328,7 +1328,7 @@ void fire_beam( bolt &pbolt, item_def *item ) #ifdef WIN32CONSOLE bool oldValue = true; if (!pbolt.is_tracer) - oldValue = setBuffering(false); + oldValue = set_buffering(false); #endif while(!beamTerminate) @@ -1501,7 +1501,7 @@ void fire_beam( bolt &pbolt, item_def *item ) // that's it! #ifdef WIN32CONSOLE if (!pbolt.is_tracer) - setBuffering(oldValue); + set_buffering(oldValue); #endif } // end fire_beam(); @@ -4193,7 +4193,7 @@ void explosion( bolt &beam, bool hole_in_the_middle ) #ifdef WIN32CONSOLE bool oldValue = true; if (!beam.is_tracer) - oldValue = setBuffering(false); + oldValue = set_buffering(false); #endif // --------------------- begin boom --------------- @@ -4247,7 +4247,7 @@ void explosion( bolt &beam, bool hole_in_the_middle ) #ifdef WIN32CONSOLE if (!beam.is_tracer) - setBuffering(oldValue); + set_buffering(oldValue); #endif // duplicate old behaviour - pause after entire explosion diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 513aee997f..5fc7aac932 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -784,7 +784,7 @@ static void genetic_engineer_card(int power, deck_rarity_type rarity) MUT_BLURRY_VISION, MUT_FRAIL }; - mutation_type which_mut; + mutation_type which_mut = NUM_MUTATIONS; int numfound = 0; for ( unsigned int i = 0; i < ARRAYSIZE(bad_mutations); ++i ) { diff --git a/crawl-ref/source/libdos.cc b/crawl-ref/source/libdos.cc index 02e1b7f85c..4d05c926ea 100644 --- a/crawl-ref/source/libdos.cc +++ b/crawl-ref/source/libdos.cc @@ -9,6 +9,7 @@ // Every .cc must include AppHdr or bad things happen. #include "AppHdr.h" #include "externs.h" +#include "cio.h" #include #include @@ -127,4 +128,9 @@ int m_getch() return getch(); } +void putwch(unsigned c) +{ + putch(static_cast(c)); +} + #endif /* #if defined(DOS) */ diff --git a/crawl-ref/source/libdos.h b/crawl-ref/source/libdos.h index fd6a0a0d92..38bbd48699 100644 --- a/crawl-ref/source/libdos.h +++ b/crawl-ref/source/libdos.h @@ -12,7 +12,7 @@ void set_cursor_enabled(bool enabled); bool is_cursor_enabled(); void clear_to_end_of_line(); int getch_ck(); -void set_mouse_enabled(bool enabled) { } +static inline void set_mouse_enabled(bool enabled) { } void message_out(int mline, int colour, const char *str, int firstcol = 0, bool newline = true); @@ -21,9 +21,6 @@ inline void update_screen() { } -inline void putwch(unsigned c) -{ - putch(static_cast(c)); -} +void putwch(unsigned c); #endif diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 42f730a08e..de676656b7 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -69,6 +69,7 @@ #include #include "AppHdr.h" #include "version.h" +#include "cio.h" #include "defines.h" #include "stuff.h" #include "view.h" -- cgit v1.2.3-54-g00ecf