X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Fctsupport.h;h=4b42791df6b770ad0d93d3fc95c88dae17563c44;hp=d843a085b9cb899eb3936e42c1711f7c2d9fb723;hb=4f15a69a3150f180bd93fcbe1c87dbaca92a77ad;hpb=c00c639073653fac7463a88f2b000f263236550d diff --git a/include/ctsupport.h b/include/ctsupport.h index d843a08..4b42791 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -7,9 +7,9 @@ ** Date Started: Dec. 83 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.22 2001/01/02 16:02:12 kevin Exp $ +** $Id: ctsupport.h,v 1.26 2003/03/23 18:37:42 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -54,8 +54,12 @@ #include #endif +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif #define OK TRUE /*----------------------------------------------------------------------*/ @@ -157,6 +161,7 @@ char *str_upper(char *str); void sys_error(int severity, const char *msg, ...); void sys_verror (std::string& strOutput, int severity, const char *msg, va_list arg); void sys_error_level(int severity); +extern unsigned long int g_lSysErrorMaxCount; // Math Section @@ -191,6 +196,10 @@ template inline T nearest (double x) { return (x > 0 ? static_cast(x+0.5) : static_cast(x-0.5)); } +template +inline T maxValue (T x, T y) +{ return (x > y ? x : y); } + inline bool isEven (int n) { return (n % 2) == 0; } @@ -295,8 +304,8 @@ unsigned int cio_kb_waitc(const char *astr, int beep); // ASCII Section #define BACKSPACE 8 -#define LF 0x0A -#define CR 0x0D +// #define LF 0x0A +// #define CR 0x0D #define BELL 0x07 #define SQUOTE '\''