diff --git a/VBA.vcproj b/VBA.vcproj
index 4d8f8841..9ee817de 100644
--- a/VBA.vcproj
+++ b/VBA.vcproj
@@ -50,6 +50,7 @@
/>
@@ -527,7 +528,7 @@
@@ -561,7 +562,7 @@
@@ -595,7 +596,7 @@
diff --git a/src/System.h b/src/System.h
index bbae9749..7c102e16 100644
--- a/src/System.h
+++ b/src/System.h
@@ -20,7 +20,9 @@
#ifndef VBA_SYSTEM_H
#define VBA_SYSTEM_H
+#ifndef _MSC_VER
#include
+#endif
#include "unzip.h"
@@ -28,6 +30,7 @@
#define NULL 0
#endif
+#ifndef _MSC_VER
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
@@ -38,6 +41,14 @@ typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
+#else
+typedef unsigned __int64 u64;
+typedef signed char s8;
+typedef signed short s16;
+typedef signed int s32;
+typedef signed __int64 s64;
+#endif
+
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
diff --git a/src/hq3x32.cpp b/src/hq3x32.cpp
index e8d48d58..366e4a41 100644
--- a/src/hq3x32.cpp
+++ b/src/hq3x32.cpp
@@ -17,7 +17,13 @@
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Util.h"
#define __STDC_CONSTANT_MACROS
+
+#ifndef _MSC_VER
#include
+#else
+typedef unsigned int uint32_t;
+#endif
+
extern "C"
{
diff --git a/src/hq_shared32.cpp b/src/hq_shared32.cpp
index 66a85936..400e6c8a 100644
--- a/src/hq_shared32.cpp
+++ b/src/hq_shared32.cpp
@@ -3,7 +3,7 @@
// Copyright (C) 2005 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
+// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
@@ -18,7 +18,13 @@
#include "hq_shared32.h"
#define __STDC_CONSTANT_MACROS
+
+#ifndef _MSC_VER
#include
+#else
+typedef unsigned __int64 uint64_t;
+#define UINT64_C(x) x;
+#endif
const uint64_t reg_blank = UINT64_C(0x0000000000000000);
const uint64_t const7 = UINT64_C(0x0000000700070007);
diff --git a/src/interp.h b/src/interp.h
index ff6ce3e8..f26a71f3 100644
--- a/src/interp.h
+++ b/src/interp.h
@@ -32,7 +32,13 @@
#define __INTERP_H
#define __STDC_CONSTANT_MACROS
+
+#ifndef _MSC_VER
#include
+#else
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#endif
typedef uint16_t interp_uint16;
typedef uint32_t interp_uint32;