r256: *** empty log message ***
[ctsim.git] / include / ctsupport.h
index ac3ffe0732ccdbfbd4f675d0770c626df206e40c..6263b69bd88228019a0e5f930d3ec66dc930aa46 100644 (file)
@@ -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
 #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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cstdarg>
 
 #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)\r
 { return (a >= b ? a : b); }\r
 \r
+inline double dmax (double a, double b)\r
+{ return (a >= b ? a : b); }\r
+\r
 template<class T>
 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 */