X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fctsupport.h;h=9df0c68db548251c05b63e4e97bc40ad6987d468;hb=06066d9192936b4c4cc69847cd4c1f5aa7017829;hp=d52c0830be799ba27329a63b9c2d890b6886a392;hpb=9f29c8b32c972db1178d6f8551d5cd57ceb67083;p=ctsim.git diff --git a/include/ctsupport.h b/include/ctsupport.h index d52c083..9df0c68 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.23 2001/01/28 19:10:18 kevin Exp $ +** $Id: ctsupport.h,v 1.25 2003/01/22 22:15:10 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 /*----------------------------------------------------------------------*/ @@ -191,6 +195,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 +303,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 '\''