none
This commit is contained in:
@@ -154,12 +154,6 @@ template <class T> inline bool make_bool(T a) { return a ? true : fal
|
||||
// ------------------------------------------------------------------
|
||||
// Legacy defines
|
||||
|
||||
#ifndef AND
|
||||
#define NOT !
|
||||
#define AND &&
|
||||
#define OR ||
|
||||
#endif
|
||||
|
||||
#define RngV in_range
|
||||
#define AbsV absolute
|
||||
#define CmpV compare_two
|
||||
|
@@ -55,7 +55,7 @@ extern "C" {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__)
|
||||
#if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__)
|
||||
|
||||
long filelength(int handle) {
|
||||
|
||||
@@ -133,7 +133,7 @@ int unlock(int handle, long ofs, long length)
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__UNIX__) or defined(__CYGWIN__)
|
||||
#if defined(__UNIX__) || defined(__CYGWIN__)
|
||||
|
||||
int lock(int handle, long offset, long length) {
|
||||
|
||||
@@ -151,7 +151,7 @@ int lock(int handle, long offset, long length) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__UNIX__) or defined(__CYGWIN__)
|
||||
#if defined(__UNIX__) || defined(__CYGWIN__)
|
||||
|
||||
int unlock(int handle, long offset, long length) {
|
||||
|
||||
@@ -169,7 +169,7 @@ int unlock(int handle, long offset, long length) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__MINGW32__) or defined(_MSC_VER)
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
|
||||
int lock(int fh, long offs, long len) {
|
||||
|
||||
@@ -182,7 +182,7 @@ int lock(int fh, long offs, long len) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__MINGW32__) or defined(_MSC_VER)
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
|
||||
int unlock(int fh, long offs, long len) {
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <gshare.h>
|
||||
#if not defined(__UNIX__)
|
||||
#if !defined(__UNIX__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
// ------------------------------------------------------------------
|
||||
// Misc. defines
|
||||
|
||||
#if defined(__MSDOS__) or defined(__OS2__) or defined(__WIN32__)
|
||||
#if defined(__MSDOS__) || defined(__OS2__) || defined(__WIN32__)
|
||||
#define GOLD_SLASH_CHR '\\' // Backslash
|
||||
#define GOLD_SLASH_STR "\\"
|
||||
#define GOLD_WRONG_SLASH_CHR '/' // Fwrdslash
|
||||
@@ -119,11 +119,11 @@ struct Stamp {
|
||||
// ------------------------------------------------------------------
|
||||
// Prototypes
|
||||
|
||||
#if not defined(__GNUC__) or defined(__MINGW32__)
|
||||
#if !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#define mkdir(path,unused) mkdir(path)
|
||||
#endif
|
||||
|
||||
#ifdef __EMX__ // untested !!!
|
||||
#ifdef __EMX__
|
||||
#define getcwd _getcwd2
|
||||
#define chdir _chdir2
|
||||
#endif
|
||||
@@ -190,7 +190,7 @@ extern "C" {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__)
|
||||
#if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__)
|
||||
long filelength(int fh);
|
||||
#endif
|
||||
|
||||
@@ -215,13 +215,13 @@ int unlock(int handle, long offset, long length);
|
||||
#undef sopen
|
||||
#endif
|
||||
|
||||
#if not defined(__DJGPP__) and defined(__GNUC__)
|
||||
#if !defined(__DJGPP__) && defined(__GNUC__)
|
||||
int lock(int handle, long offset, long length);
|
||||
int unlock(int handle, long offset, long length);
|
||||
inline long tell(int fh) { return lseek(fh, 0, SEEK_CUR); }
|
||||
#endif
|
||||
|
||||
#if not defined(__MINGW32__) and not defined(__EMX__) and defined(__GNUC__)
|
||||
#if !defined(__MINGW32__) && !defined(__EMX__) && defined(__GNUC__)
|
||||
|
||||
inline int eof(int h) {
|
||||
return tell(h) > filelength(h);
|
||||
@@ -236,7 +236,7 @@ inline int sopen(const char* path, int access, int shflag, int mode) {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__UNIX__) or defined(__CYGWIN__)
|
||||
#if defined(__UNIX__) || defined(__CYGWIN__)
|
||||
inline int chsize(int handle, long size) { return ftruncate(handle, size); }
|
||||
#endif
|
||||
|
||||
|
@@ -94,7 +94,7 @@ long GetFilesize(const char* file) {
|
||||
|
||||
dword gfixstattime(time_t st_time) {
|
||||
|
||||
#if defined(__MINGW32__) or defined(__CYGWIN__)
|
||||
#if defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
struct tm &f = *gmtime(&st_time);
|
||||
#else
|
||||
struct tm &f = *localtime(&st_time);
|
||||
@@ -106,7 +106,7 @@ dword gfixstattime(time_t st_time) {
|
||||
t.ft_hour = f.tm_hour;
|
||||
t.ft_min = f.tm_min;
|
||||
t.ft_tsec = f.tm_sec / 2;
|
||||
#if defined(__MINGW32__) or defined(__CYGWIN__)
|
||||
#if defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
union {
|
||||
DWORD t;
|
||||
struct {
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
#include <gkbdunix.h>
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ int curses_initialized = 0;
|
||||
// ------------------------------------------------------------------
|
||||
// Global keyboard data
|
||||
|
||||
#if defined(__WIN32__) and not defined(__USE_NCURSES__)
|
||||
#if defined(__WIN32__) && !defined(__USE_NCURSES__)
|
||||
HANDLE gkbd_hin;
|
||||
DWORD gkbd_kbdmode;
|
||||
int gkbd_nt;
|
||||
@@ -171,13 +171,13 @@ GKbd::GKbd() {
|
||||
extkbd = _farpeekb (_dos_ds, 0x0496) & (1 << 4);
|
||||
#elif defined(__MSDOS__)
|
||||
extkbd = *((byte*)0x0496) & (1 << 4);
|
||||
#elif defined(__OS2__) or defined(__WIN32__)
|
||||
#elif defined(__OS2__) || defined(__WIN32__)
|
||||
extkbd = true;
|
||||
#endif
|
||||
|
||||
Init();
|
||||
|
||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
|
||||
gkbd_keymap_init();
|
||||
|
||||
@@ -908,7 +908,7 @@ bool is_numpad_key(const INPUT_RECORD& inp) {
|
||||
// ------------------------------------------------------------------
|
||||
// Numpad translation table
|
||||
|
||||
#elif defined(__MSDOS__) or defined(__OS2__)
|
||||
#elif defined(__MSDOS__) || defined(__OS2__)
|
||||
|
||||
const word numpad_keys[] = {
|
||||
0x4737, 0x4838, 0x4939, 0x0000,
|
||||
|
@@ -221,7 +221,7 @@
|
||||
#define Key_S_F11 0x8700 // S <F11> - - E -
|
||||
#define Key_S_F12 0x8800 // S <F12> - - E -
|
||||
#define Key_S_Tab 0x0F00 // S <Tab> - - - -
|
||||
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
|
||||
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
|
||||
#define Key_S_Ins 0xD200 // S <Ins> Grey - G E T
|
||||
#define Key_S_Lft 0xCB00 // S <Left> Grey - G E T
|
||||
#define Key_S_PgDn 0xD100 // S <PgDn> Grey - G E T
|
||||
|
@@ -172,7 +172,7 @@ inline void i86::genint(int intno) {
|
||||
}
|
||||
|
||||
|
||||
#if defined(__WATCOMC__) and defined(__386__)
|
||||
#if defined(__WATCOMC__) && defined(__386__)
|
||||
inline int __dpmi_allocate_dos_memory(long len, int &buf) {
|
||||
|
||||
i86 cpu;
|
||||
@@ -203,7 +203,7 @@ inline void __dpmi_free_dos_memory(int buffer) {
|
||||
// ------------------------------------------------------------------
|
||||
// A more portable version of MK_FP()
|
||||
|
||||
#if defined(__WATCOMC__) and defined(__386__)
|
||||
#if defined(__WATCOMC__) && defined(__386__)
|
||||
|
||||
#define gmkfp(s,o) ((s << 4) + o)
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if not defined(__GNUC__) or defined(__DJGPP__) or defined(__EMX__) or defined(__MINGW32__)
|
||||
#if !defined(__GNUC__) || defined(__DJGPP__) || defined(__EMX__) || defined(__MINGW32__)
|
||||
#include <share.h>
|
||||
#if defined(__MINGW32__) // SH_COMPAT doesn't work in Mingw32
|
||||
#undef SH_COMPAT
|
||||
|
@@ -51,7 +51,7 @@ gsnd::gsnd() {
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
mpx = -1;
|
||||
#if (defined(__WATCOMC__) and defined(__386__)) or defined(__DJGPP__)
|
||||
#if (defined(__WATCOMC__) && defined(__386__)) || defined(__DJGPP__)
|
||||
buffer = -1;
|
||||
#else
|
||||
buffer = NULL;
|
||||
@@ -98,7 +98,7 @@ int gsnd::call_api(uint al, uint bx) {
|
||||
void gsnd::free_buffer() {
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__))
|
||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
|
||||
if(buffer != -1) {
|
||||
__dpmi_free_dos_memory(buffer);
|
||||
buffer = -1;
|
||||
@@ -226,7 +226,7 @@ int gsnd::open(const char* file) {
|
||||
goto try_again;
|
||||
case 0x02:
|
||||
free_buffer();
|
||||
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__))
|
||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
|
||||
int seg = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer);
|
||||
if(seg == -1)
|
||||
return -1;
|
||||
|
@@ -55,7 +55,7 @@ protected:
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
int mpx;
|
||||
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__))
|
||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
|
||||
int buffer;
|
||||
#else
|
||||
char* buffer;
|
||||
|
@@ -121,7 +121,7 @@ inline char* strskip_wht(char* p) { while(*p and isspace(*p)) p++; return p; }
|
||||
inline const char* strskip_digits(const char* p) { return p+strspn(p, "0123456789"); }
|
||||
inline char* strskip_digits(char* p) { return p+strspn(p, "0123456789"); }
|
||||
|
||||
#if defined(_MSC_VER) or (defined(__GNUC__) and not defined(__DJGPP__)) or defined(__WATCOMC__)
|
||||
#if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__DJGPP__)) || defined(__WATCOMC__)
|
||||
inline char * stpcpy(char* dest, const char* src) {
|
||||
while ((*dest++ = *src++) != NUL) {}
|
||||
return --dest;
|
||||
|
@@ -594,7 +594,7 @@ GTok::GTok(char* sep) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUC__) and not defined(__EMX__)
|
||||
#if defined(__GNUC__) && !defined(__EMX__)
|
||||
|
||||
char* strupr(char* s) {
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
|
||||
#if defined(__OS2__)
|
||||
#define CLIP_NAME "OS/2 Clipboard"
|
||||
#elif defined(__WIN32__) or defined(__MSDOS__)
|
||||
#elif defined(__WIN32__) || defined(__MSDOS__)
|
||||
#define CLIP_NAME "Windows Clipboard"
|
||||
#else
|
||||
#define CLIP_NAME "Fake Clipboard"
|
||||
|
@@ -82,7 +82,7 @@ int GMTsk::os2() {
|
||||
#if defined(__OS2__)
|
||||
detected = GMTSK_OS2;
|
||||
name = "OS/2";
|
||||
#elif not defined(__GNUC__)
|
||||
#elif !defined(__GNUC__)
|
||||
if(_osmajor >= 10) {
|
||||
detected = GMTSK_OS2;
|
||||
name = "OS/2";
|
||||
@@ -115,7 +115,7 @@ int GMTsk::win32() {
|
||||
|
||||
int GMTsk::windows() {
|
||||
|
||||
#if defined(__MSDOS__) and not defined(__DJGPP__)
|
||||
#if defined(__MSDOS__) && !defined(__DJGPP__)
|
||||
i86 cpu;
|
||||
cpu.ax(0x352F);
|
||||
cpu.genint(0x21);
|
||||
@@ -136,7 +136,7 @@ int GMTsk::windows() {
|
||||
|
||||
int GMTsk::desqview() {
|
||||
|
||||
#if defined(__MSDOS__) and not defined(__DJGPP__)
|
||||
#if defined(__MSDOS__) && !defined(__DJGPP__)
|
||||
i86 cpu;
|
||||
cpu.cx(0x4445);
|
||||
cpu.dx(0x5351);
|
||||
@@ -157,7 +157,7 @@ int GMTsk::desqview() {
|
||||
|
||||
int GMTsk::dosint28() {
|
||||
|
||||
#if defined(__MSDOS__) and not defined(__DJGPP__)
|
||||
#if defined(__MSDOS__) && !defined(__DJGPP__)
|
||||
detected = GMTSK_DOS;
|
||||
name = "DOS";
|
||||
#endif
|
||||
@@ -191,7 +191,7 @@ void GMTsk::timeslice() {
|
||||
Sleep(5);
|
||||
break;
|
||||
#endif
|
||||
#if defined(__MSDOS__) or defined(__OS2__)
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
case GMTSK_OS2:
|
||||
#if defined(__OS2__)
|
||||
DosSleep(5);
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__WIN32__) or defined(__OS2__) or defined(__DJGPP__)
|
||||
#if defined(__WIN32__) || defined(__OS2__) || defined(__DJGPP__)
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -131,7 +131,7 @@ ulong* GTag::Add(ulong __tagn) {
|
||||
uint _reln = ToReln(__tagn, TAGN_CLOSEST);
|
||||
|
||||
// Do we have it already?
|
||||
if((_reln == RELN_INVALID) OR (tag[_reln-1] != __tagn)) {
|
||||
if((_reln == RELN_INVALID) or (tag[_reln-1] != __tagn)) {
|
||||
|
||||
// Resize tag array to make room for the new number
|
||||
Resize(tags+1);
|
||||
@@ -143,7 +143,7 @@ ulong* GTag::Add(ulong __tagn) {
|
||||
// - no tags in array (if _reln == RELN_INVALID)
|
||||
// - tag[_reln-1] is larger than __tagn
|
||||
|
||||
if(_reln AND (tag[_reln-1] > __tagn))
|
||||
if(_reln and (tag[_reln-1] > __tagn))
|
||||
_reln--;
|
||||
|
||||
// Move data to make room for the new tag number
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
uint SetCount(uint n) { tags = count = n; return count; }
|
||||
|
||||
void Set(uint n, ulong t) { tag[n] = t; }
|
||||
ulong Get(uint n) { return (tags AND (n<tags)) ? tag[n] : TAGN_INVALID; }
|
||||
ulong Get(uint n) { return (tags and (n<tags)) ? tag[n] : TAGN_INVALID; }
|
||||
|
||||
ulong& operator[](uint n) { return tag[n]; }
|
||||
ulong& at(uint n) { return tag[n]; }
|
||||
|
@@ -44,7 +44,7 @@ char* ggetosstring(void) {
|
||||
|
||||
if(*osstring == NUL) {
|
||||
|
||||
#if defined(__UNIX__) or defined(__DJGPP__) or defined(__EMX__)
|
||||
#if defined(__UNIX__) || defined(__DJGPP__) || defined(__EMX__)
|
||||
|
||||
struct utsname info;
|
||||
|
||||
|
@@ -58,7 +58,7 @@
|
||||
// ------------------------------------------------------------------
|
||||
// Check if Borland C++ for OS/2 1.0 header has been fixed
|
||||
|
||||
#if defined(__OS2__) and defined(__BORLANDC__)
|
||||
#if defined(__OS2__) && defined(__BORLANDC__)
|
||||
#if __BORLANDC__ <= 0x400
|
||||
#ifndef BCOS2_BSESUB_FIXED
|
||||
#error There is a bug in the BSESUB.H header. Please fix it.
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
static bool __vcurhidden = false;
|
||||
|
||||
#if not defined(__USE_NCURSES__)
|
||||
#if !defined(__USE_NCURSES__)
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -103,7 +103,7 @@ inline WCHAR gvid_tcpr(vchar chr) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__MSDOS__) or defined(__UNIX__)
|
||||
#if defined(__MSDOS__) || defined(__UNIX__)
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
extern int __gdvdetected;
|
||||
@@ -356,7 +356,7 @@ void vputansi(int row, int col, word* buf, int len) {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // not defined(__USE_NCURSES__)
|
||||
#endif // !defined(__USE_NCURSES__)
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -393,7 +393,7 @@ int revsattr(int attr) {
|
||||
return (int)(((attr>>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08));
|
||||
}
|
||||
|
||||
#if not defined(__USE_NCURSES__)
|
||||
#if !defined(__USE_NCURSES__)
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -569,7 +569,7 @@ chtype gvid_tcpr(vchar chr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print character and attribute at specfied location
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
inline void _vputw(int row, int col, word chat) {
|
||||
|
||||
_farpokew(_dos_ds, gdmaptr(col, row), chat);
|
||||
@@ -738,7 +738,7 @@ void vputc(int row, int col, int atr, vchar chr) {
|
||||
cpu.genint(0x10);
|
||||
}
|
||||
|
||||
#elif defined(__OS2__) or defined(__WIN32__)
|
||||
#elif defined(__OS2__) || defined(__WIN32__)
|
||||
|
||||
vputw(row, col, vcatch(chr, atr));
|
||||
|
||||
@@ -854,7 +854,7 @@ void vputs(int row, int col, int atr, const char* str) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print string with attribute at specfied location
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vputns(int row, int col, int atr, const char* str, uint width) {
|
||||
|
||||
char fillchar = ' ';
|
||||
@@ -967,7 +967,7 @@ void vputns(int row, int col, int atr, const char* str, uint width) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print horizontal line of character and attribute
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
void _vputx(int row, int col, int atr, char chr, uint len) {
|
||||
|
||||
gdma p = gdmaptr(col, row);
|
||||
@@ -1040,7 +1040,7 @@ void vputx(int row, int col, int atr, vchar chr, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print vertical line of character and attribute
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
inline void _vputy(int row, int col, int atr, char chr, uint len) {
|
||||
|
||||
gdma p = gdmaptr(col, row);
|
||||
@@ -1130,7 +1130,7 @@ void vputy(int row, int col, int atr, vchar chr, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Get character and attribute at cursor position
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
inline word _vgetw(int row, int col) {
|
||||
|
||||
return _farpeekw(_dos_ds, gdmaptr(col, row));
|
||||
@@ -1203,7 +1203,7 @@ vatch vgetw(int row, int col) {
|
||||
|
||||
void vgetc(int row, int col, int* atr, vchar* chr) {
|
||||
|
||||
if((row < 0) || (row > gvid->numrows-1) || (col < 0) || (col > gvid->numcols-1)) {
|
||||
if((row < 0) or (row > gvid->numrows-1) or (col < 0) or (col > gvid->numcols-1)) {
|
||||
*chr = ' ';
|
||||
*atr = 0;
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ void vgetc(int row, int col, int* atr, vchar* chr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Scroll screen area
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
||||
|
||||
word empty = (atr << 8) | ' ';
|
||||
@@ -1461,7 +1461,7 @@ void vclrscr() {
|
||||
// ------------------------------------------------------------------
|
||||
// Clears the screen using given attribute and homes the cursor
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vclrscr(int atr) {
|
||||
|
||||
int len = gvid->numrows * gvid->numcols;
|
||||
@@ -1529,7 +1529,7 @@ void vclrscr(int atr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Saves the current screen and returns pointer to buffer
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vsave(word* buf, int len1, int srow, int scol, int erow) {
|
||||
|
||||
const int len2 = len1*sizeof(word);
|
||||
@@ -1645,7 +1645,7 @@ vsavebuf* vsave(int srow, int scol, int erow, int ecol) {
|
||||
// ------------------------------------------------------------------
|
||||
// Redraws a previously saved screen
|
||||
|
||||
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__)
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vredraw(word* buf, int len1, int srow, int scol, int erow) {
|
||||
|
||||
const int len2 = len1*sizeof(word);
|
||||
@@ -1972,7 +1972,7 @@ void vcursmall() {
|
||||
// 14 - solid block
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if not defined(__USE_NCURSES__)
|
||||
#if !defined(__USE_NCURSES__)
|
||||
|
||||
char* __box_table[] = {
|
||||
|
||||
@@ -2069,7 +2069,7 @@ chtype _box_table(int type, int c) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
void gvid_boxcvt(char* s) {
|
||||
|
||||
while(*s) {
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include <gmemall.h>
|
||||
#include <gmemdbg.h>
|
||||
#include <gstrall.h>
|
||||
#if defined(__WATCOMC__) or defined(__DJGPP__)
|
||||
#if defined(__WATCOMC__) || defined(__DJGPP__)
|
||||
#include <conio.h>
|
||||
#endif
|
||||
#include <gvidall.h>
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if not defined(__USE_NCURSES__) and defined(__UNIX__)
|
||||
#if !defined(__USE_NCURSES__) && defined(__UNIX__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
@@ -62,7 +62,7 @@
|
||||
// ------------------------------------------------------------------
|
||||
// Check if Borland C++ for OS/2 1.0 header has been fixed
|
||||
|
||||
#if defined(__OS2__) and defined(__BORLANDC__)
|
||||
#if defined(__OS2__) && defined(__BORLANDC__)
|
||||
#if __BORLANDC__ <= 0x400
|
||||
#ifndef BCOS2_BSESUB_FIXED
|
||||
#error There is a bug in the BSESUB.H header. Please fix it.
|
||||
@@ -189,11 +189,11 @@ void GVid::init() {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
dmaptr = dmadir = NULL;
|
||||
#elif defined(__WATCOMC__) and defined(__386__)
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
dmaptr = dmadir = (gdma)(videoseg << 4);
|
||||
#elif defined(__DJGPP__)
|
||||
dmaptr = dmadir = ScreenPrimary;
|
||||
#elif defined(__OS2__) or defined(__WIN32__)
|
||||
#elif defined(__OS2__) || defined(__WIN32__)
|
||||
dmaptr = dmadir = NULL;
|
||||
#elif defined(__UNIX__)
|
||||
dmaptr = (gdma)throw_xcalloc((orig.screen.rows+1)*orig.screen.columns, sizeof(word));
|
||||
@@ -319,7 +319,7 @@ int GVid::detectadapter() {
|
||||
#ifndef __DJGPP__
|
||||
|
||||
// Set video segment
|
||||
#if defined(__BORLANDC__) and defined(__DPMI32__)
|
||||
#if defined(__BORLANDC__) && defined(__DPMI32__)
|
||||
videoseg = (word)((adapter & V_MONO) ? __SegB000 : __SegB800);
|
||||
#else
|
||||
videoseg = (word)((adapter & V_MONO) ? 0xB000 : 0xB800);
|
||||
@@ -340,7 +340,7 @@ int GVid::detectadapter() {
|
||||
|
||||
__gdvdetected = true;
|
||||
|
||||
#if defined(__WATCOMC__) and defined(__386__)
|
||||
#if defined(__WATCOMC__) && defined(__386__)
|
||||
memset(&RMI, 0, sizeof(RMI));
|
||||
RMI.EAX = 0x0000FE00;
|
||||
RMI.ES = videoseg;
|
||||
@@ -396,7 +396,6 @@ int GVid::detectadapter() {
|
||||
FILE_SHARE_WRITE | FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH, NULL);
|
||||
// gvid_hout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
adapter = V_VGA;
|
||||
|
||||
@@ -762,7 +761,7 @@ void GVid::setrows(int _rows) {
|
||||
}
|
||||
|
||||
if(adapter >= V_EGA) {
|
||||
if(_rows == 28 and adapter >= V_VGA) { // vga-only
|
||||
if((_rows == 28) and (adapter >= V_VGA)) { // vga-only
|
||||
cpu.ax(0x1202);
|
||||
cpu.bl(0x30);
|
||||
cpu.genint(0x10);
|
||||
@@ -811,7 +810,7 @@ void GVid::setrows(int _rows) {
|
||||
viomodeinfo.row = (USHORT)_rows;
|
||||
VioSetMode(&viomodeinfo, 0);
|
||||
|
||||
#elif defined(__WIN32__) or defined(__UNIX__)
|
||||
#elif defined(__WIN32__) || defined(__UNIX__)
|
||||
|
||||
NW(_rows);
|
||||
|
||||
@@ -852,7 +851,7 @@ void GVid::setoverscan(int _overscan) {
|
||||
viooverscan.color = (BYTE)_overscan;
|
||||
VioSetState(&viooverscan, 0);
|
||||
|
||||
#elif defined(__WIN32__) or defined(__UNIX__)
|
||||
#elif defined(__WIN32__) || defined(__UNIX__)
|
||||
|
||||
NW(_overscan);
|
||||
|
||||
@@ -910,7 +909,7 @@ void GVid::setintensity(int _intensity) {
|
||||
viointensity.type = 0x0002;
|
||||
VioSetState(&viointensity, 0);
|
||||
|
||||
#elif defined(__WIN32__) or defined(__UNIX__)
|
||||
#elif defined(__WIN32__) || defined(__UNIX__)
|
||||
|
||||
NW(_intensity);
|
||||
|
||||
@@ -959,7 +958,7 @@ void GVid::getpalette(int* _palette) {
|
||||
for(byte n=0; n<16; n++)
|
||||
_palette[n] = pviopalstate->acolor[n];
|
||||
|
||||
#elif defined(__WIN32__) or defined(__UNIX__)
|
||||
#elif defined(__WIN32__) || defined(__UNIX__)
|
||||
|
||||
NW(_palette);
|
||||
|
||||
@@ -1004,7 +1003,7 @@ void GVid::setpalette(int* _palette) {
|
||||
pviopalstate->acolor[n] = (USHORT)_palette[n];
|
||||
VioSetState(pviopalstate, 0);
|
||||
|
||||
#elif defined(__WIN32__) or defined(__UNIX__)
|
||||
#elif defined(__WIN32__) || defined(__UNIX__)
|
||||
|
||||
NW(_palette);
|
||||
|
||||
@@ -1033,7 +1032,7 @@ void GVid::resize_screen(int columns, int rows) {
|
||||
bufwrd = (vatch*)throw_xrealloc(bufwrd, (numcols+1)*sizeof(vatch));
|
||||
bufansi = (vchar*)throw_xrealloc(bufansi, 1+(11*numcols));
|
||||
|
||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
dmaptr = (gdma)throw_xrealloc(dmaptr, (rows+1)*columns*sizeof(word));
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user