From: Kevin M. Rosenberg Date: Sun, 17 Dec 2000 23:09:46 +0000 (+0000) Subject: r278: msvc compatibility X-Git-Tag: debian-4.5.3-3~739 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=aa41f74ce0ec15bc7952ed9da629dbe294429a61 r278: msvc compatibility --- 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