r278: msvc compatibility
[ctsim.git] / include / msvc_compat.h
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