X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=include%2Fctsupport.h;h=6263b69bd88228019a0e5f930d3ec66dc930aa46;hb=f313b7708626e8900c4eeea6cf73d4507057a1c6;hp=ac3ffe0732ccdbfbd4f675d0770c626df206e40c;hpb=55426f4170ed9dc777c3cec3741e4a59e6eebd38;p=ctsim.git diff --git a/include/ctsupport.h b/include/ctsupport.h index ac3ffe0..6263b69 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.9 2000/12/06 15:17:51 kevin Exp $ +** $Id: ctsupport.h,v 1.11 2000/12/16 02:44:26 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -33,17 +33,17 @@ #include "config.h" #endif -#ifdef _WIN32 +#ifdef MSVC #define snprintf _snprintf #endif #define STR_MAX_LEN 255 #define STR_SIZE STR_MAX_LEN+1 -#include -#include -#include -#include +#include +#include +#include +#include #define TRUE 1 #define FALSE 0 @@ -92,7 +92,7 @@ typedef struct timedate_st TIMEDATE; /* codes for open command */ -#if MICROSOFT +#ifdef MSVC #define OPEN_RDONLY O_RDONLY /* other system use standard codes */ #define OPEN_WRONLY O_WRONLY /* for binary */ #define OPEN_RDWR O_RDWR @@ -114,7 +114,7 @@ typedef struct timedate_st TIMEDATE; /*----------------------------------------------------------------------*/ -#if defined(MICROSOFT) || ! defined(SIZEOF_INT) +#if defined(MSVC) || ! defined(SIZEOF_INT) #define SIZEOF_INT 4 #define SIZEOF_LONG 4 #define SIZEOF_SHORT 2 @@ -225,6 +225,9 @@ inline T nearest (double x) inline int imax (int a, int b) { return (a >= b ? a : b); } +inline double dmax (double a, double b) +{ return (a >= b ? a : b); } + template inline T clamp (T value, T lowerBounds, T upperBounds) { return (value >= upperBounds ? upperBounds : (value <= lowerBounds ? lowerBounds : value )); } @@ -345,4 +348,4 @@ unsigned int cio_kb_waitc(const char *astr, int beep); #define PERIOD '.' #define VERTBAR '|' -#endif /* #ifndef ASCII_H */ +#endif /* #ifndef CTSUPPORT_H */