r278: msvc compatibility
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 17 Dec 2000 23:09:46 +0000 (23:09 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 17 Dec 2000 23:09:46 +0000 (23:09 +0000)
include/ct.h
include/ctsupport.h
include/msvc_compat.h [new file with mode: 0644]

index e920a562bcf4a1ad503779b89b6afa49856d79ce..efe5839d2abbac88007c6b2ddfc9ede98a58961f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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
 #define CT_H
 
 #ifdef MSVC
 #define CT_H
 
 #ifdef MSVC
- // extern "C" {int strcasecmp(const char*, const char*);}
-  typedef long off_t;
-  #define HAVE_STRING_H 1\r
-  #include <fcntl.h>\r
-  #define strdup _strdup
-  #define strcasecmp _stricmp
-  #define strncasecmp _strnicmp
+#include "msvc_compat.h"
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
index ba6030d95e3ec51c936e19d137c5e626405d4d05..c933488a4b92c3071f92cc83ddfe15c8f559ecc2 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **
 **  This program is free software; you can redistribute it and/or modify
@@ -34,7 +34,7 @@
 #endif
 
 #ifdef MSVC
 #endif
 
 #ifdef MSVC
-#define snprintf _snprintf
+#include "msvc_compat.h"
 #endif
 
 #define STR_MAX_LEN 255
 #endif
 
 #define STR_MAX_LEN 255
diff --git a/include/msvc_compat.h b/include/msvc_compat.h
new file mode 100644 (file)
index 0000000..d77f435
--- /dev/null
@@ -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 <fcntl.h>
+  #define strdup _strdup
+  #define strcasecmp _stricmp
+  #define strncasecmp _strnicmp
+  #define snprintf _snprintf
+  #define vsnprintf _vsnprintf
+#endif
+#endif