From aa41f74ce0ec15bc7952ed9da629dbe294429a61 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 17 Dec 2000 23:09:46 +0000 Subject: [PATCH] r278: msvc compatibility --- include/ct.h | 10 ++-------- include/ctsupport.h | 4 ++-- include/msvc_compat.h | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 include/msvc_compat.h diff --git a/include/ct.h b/include/ct.h index e920a56..efe5839 100644 --- a/include/ct.h +++ b/include/ct.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ct.h,v 1.45 2000/12/16 06:12:47 kevin Exp $ +** $Id: ct.h,v 1.46 2000/12/17 23:09:46 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -29,13 +29,7 @@ #define CT_H #ifdef MSVC - // extern "C" {int strcasecmp(const char*, const char*);} - typedef long off_t; - #define HAVE_STRING_H 1 - #include - #define strdup _strdup - #define strcasecmp _stricmp - #define strncasecmp _strnicmp +#include "msvc_compat.h" #endif #ifdef HAVE_CONFIG_H diff --git a/include/ctsupport.h b/include/ctsupport.h index ba6030d..c933488 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.13 2000/12/16 06:12:47 kevin Exp $ +** $Id: ctsupport.h,v 1.14 2000/12/17 23:09:46 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -34,7 +34,7 @@ #endif #ifdef MSVC -#define snprintf _snprintf +#include "msvc_compat.h" #endif #define STR_MAX_LEN 255 diff --git a/include/msvc_compat.h b/include/msvc_compat.h new file mode 100644 index 0000000..d77f435 --- /dev/null +++ b/include/msvc_compat.h @@ -0,0 +1,15 @@ +#ifndef __MSVC_COMPAT_H +#define __MSVC_COMPAT_H + +#ifdef MSVC + typedef long off_t; + #define HAVE_STRING_H 1 + #define HAVE_VSNPRINTF 1 + #include + #define strdup _strdup + #define strcasecmp _stricmp + #define strncasecmp _strnicmp + #define snprintf _snprintf + #define vsnprintf _vsnprintf +#endif +#endif -- 2.34.1