summaryrefslogtreecommitdiff
path: root/compat/msvc.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/msvc.h')
-rw-r--r--compat/msvc.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/compat/msvc.h b/compat/msvc.h
new file mode 100644
index 0000000000..580bb55bf4
--- /dev/null
+++ b/compat/msvc.h
@@ -0,0 +1,29 @@
+#ifndef __MSVC__HEAD
+#define __MSVC__HEAD
+
+#include <direct.h>
+#include <process.h>
+#include <malloc.h>
+#include <io.h>
+
+/* porting function */
+#define inline __inline
+#define __inline__ __inline
+#define __attribute__(x)
+#define strncasecmp _strnicmp
+#define ftruncate _chsize
+#define strtoull _strtoui64
+#define strtoll _strtoi64
+
+static __inline int strcasecmp (const char *s1, const char *s2)
+{
+ int size1 = strlen(s1);
+ int sisz2 = strlen(s2);
+ return _strnicmp(s1, s2, sisz2 > size1 ? sisz2 : size1);
+}
+
+#undef ERROR
+
+#include "compat/mingw.h"
+
+#endif