diff --git a/py/mpconfig.h b/py/mpconfig.h
index 9acfc142f507dc11b7391a68982061f4401a19bf..9ff3dd77b64530617484b7e7603295d282650c49 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -312,4 +312,6 @@ typedef double mp_float_t;
 #endif //INT_FMT
 
 // Modifier for function which doesn't return
+#ifndef NORETURN
 #define NORETURN __attribute__((noreturn))
+#endif
diff --git a/py/mpz.c b/py/mpz.c
index d6eca30685469c33a550f5a058411912a2cca76b..8eed283f04e27c997c2f0325d04b206e683665e0 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -1092,8 +1092,11 @@ mpz_t *mpz_gcd(const mpz_t *z1, const mpz_t *z2) {
 */
 mpz_t *mpz_lcm(const mpz_t *z1, const mpz_t *z2)
 {
-    if (z1->len == 0 || z2->len == 0)
-        return mpz_zero();
+    // braces below are required for compilation to succeed with CL, see bug report
+    // https://connect.microsoft.com/VisualStudio/feedback/details/864169/compilation-error-when-braces-are-left-out-of-single-line-if-statement
+    if (z1->len == 0 || z2->len == 0) {
+        return mpz_zero();
+    }
 
     mpz_t *gcd = mpz_gcd(z1, z2);
     mpz_t *quo = mpz_zero();
diff --git a/py/objint.c b/py/objint.c
index c8bcb6080cb276033bf2a4044734265901e7a89b..73b4c5d0be2e9a9797929542555e481f8cb073b4 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -303,7 +303,7 @@ STATIC mp_obj_t int_from_bytes(uint n_args, const mp_obj_t *args) {
 
     // convert the bytes to an integer
     machine_uint_t value = 0;
-    for (const byte* buf = bufinfo.buf + bufinfo.len - 1; buf >= (byte*)bufinfo.buf; buf--) {
+    for (const byte* buf = (const byte*)bufinfo.buf + bufinfo.len - 1; buf >= (byte*)bufinfo.buf; buf--) {
         value = (value << 8) | *buf;
     }
 
diff --git a/py/runtime.c b/py/runtime.c
index a5a5bc5a4a4b0eb9b0245fd1bc11babd3b4baff8..7a701fec578792e4d6c26cd58deedb86f73ead0b 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
+#include <alloca.h>
 
 #include "mpconfig.h"
 #include "nlr.h"
@@ -1074,11 +1075,12 @@ import_error:
     uint pkg_name_len;
     const char *pkg_name = mp_obj_str_get_data(dest[0], &pkg_name_len);
 
-    char dot_name[pkg_name_len + 1 + qstr_len(name)];
+    const uint dot_name_len = pkg_name_len + 1 + qstr_len(name);
+    char *dot_name = alloca(dot_name_len);
     memcpy(dot_name, pkg_name, pkg_name_len);
     dot_name[pkg_name_len] = '.';
     memcpy(dot_name + pkg_name_len + 1, qstr_str(name), qstr_len(name));
-    qstr dot_name_q = qstr_from_strn(dot_name, sizeof(dot_name));
+    qstr dot_name_q = qstr_from_strn(dot_name, dot_name_len);
 
     mp_obj_t args[5];
     args[0] = MP_OBJ_NEW_QSTR(dot_name_q);
diff --git a/windows/.gitignore b/windows/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d26ef4db7fcbd3c9355d1ef3c0d4805f47a40c91
--- /dev/null
+++ b/windows/.gitignore
@@ -0,0 +1,9 @@
+*.user
+*.*sdf
+*.suo
+*.sln
+*.exe
+*.pdb
+*.ilk
+*.filters
+/build/*
diff --git a/windows/README b/windows/README
index 28940f2c3dbcf6c427784a9bb8fa7ba11d0ab9dd..88ee5ffce3a806278d71aa9daddef76b5e73890c 100644
--- a/windows/README
+++ b/windows/README
@@ -1,10 +1,26 @@
 This is experimental, community-supported Windows port of MicroPython.
 It is based on Unix port, and expected to remain so.
+The port requires additional testing, debugging, and patches. Please
+consider to contribute.
+
 
 To cross-compile under Debian/Ubuntu Linux system:
 
 sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
 make CROSS_COMPILE=i586-mingw32msvc-
 
-The port requires additional testing, debugging, and patches. Please
-consider to contribute.
+
+To compile under Cygwin:
+
+Install following packages using cygwin's setup.exe: mingw-gcc-g++ make
+make CROSS_COMPILE=i686-pc-mingw32-
+
+
+To compile using Visual Studio 2013:
+
+Open micropython.vcxproj and build
+
+
+To compile using Visual Studio 2013 commandline:
+
+msbuild micropython.vcxproj
diff --git a/windows/init.c b/windows/init.c
index f78dd4c80798abba7f28ef298b2d4f63229d620d..5bb29b8f38921ecd125d370aea84b86e0d5b40cf 100644
--- a/windows/init.c
+++ b/windows/init.c
@@ -25,7 +25,12 @@
  */
 
 #include <stdlib.h>
+#include <stdio.h>
 
 void init() {
+#ifdef __MINGW32__
     putenv("PRINTF_EXPONENT_DIGITS=2");
+#else
+    _set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
 }
diff --git a/windows/micropython.vcxproj b/windows/micropython.vcxproj
new file mode 100644
index 0000000000000000000000000000000000000000..62886d1a19804cfd6ce0c277d4454c00f72466c6
--- /dev/null
+++ b/windows/micropython.vcxproj
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{740F3C30-EB6C-4B59-9C50-AE4D5A4A9D12}</ProjectGuid>
+    <RootNamespace>micropython</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="msvc/common.props" />
+    <Import Project="msvc/debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="msvc/common.props" />
+    <Import Project="msvc/release.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="msvc/common.props" />
+    <Import Project="msvc/debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="msvc/common.props" />
+    <Import Project="msvc/release.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile />
+    <Link />
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile />
+    <Link />
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile />
+    <Link />
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile />
+    <Link />
+  </ItemDefinitionGroup>
+  <ItemGroup>
+  </ItemGroup>
+  <Import Project="msvc/sources.props" />
+  <Import Project="msvc/genhdr.targets" />
+  <Target Name="GenHeaders" BeforeTargets="BuildGenerateSources" DependsOnTargets="GenerateHeaders">
+  </Target>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
index 4436b8a197cdde4e29703021cb955e87c811e716..3651a6120f955c92c06340fe794fbc16b82616be 100644
--- a/windows/mpconfigport.h
+++ b/windows/mpconfigport.h
@@ -31,6 +31,7 @@
 #define MICROPY_USE_READLINE        (0)
 #endif
 
+#define MICROPY_PATH_MAX            (260) //see minwindef.h for msvc or limits.h for mingw
 #define MICROPY_EMIT_X64            (0)
 #define MICROPY_EMIT_THUMB          (0)
 #define MICROPY_EMIT_INLINE_THUMB   (0)
@@ -46,9 +47,12 @@
 
 // type definitions for the specific machine
 
-#ifdef __LP64__
+#if defined( __MINGW32__ ) && defined( __LP64__ )
 typedef long machine_int_t; // must be pointer size
 typedef unsigned long machine_uint_t; // must be pointer size
+#elif defined ( _MSC_VER ) && defined( _WIN64 )
+typedef __int64 machine_int_t;
+typedef unsigned __int64 machine_uint_t;
 #else
 // These are definitions for machines where sizeof(int) == sizeof(void*),
 // regardless for actual size.
@@ -67,3 +71,43 @@ extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
 
 #include "realpath.h"
 #include "init.h"
+
+
+// MSVC specifics
+#ifdef _MSC_VER
+
+// Sanity check
+
+#if ( _MSC_VER < 1800 )
+    #error Can only build with Visual Studio 2013 toolset
+#endif
+
+
+//  CL specific overrides from mpconfig
+
+#define NORETURN                   __declspec(noreturn)
+#define MICROPY_EXTRA_CONSTANTS    { "dummy", 0 } //can't have zero-sized array
+
+
+// CL specific definitions
+
+#define restrict
+#define inline                      __inline
+#define STDIN_FILENO                0
+#define STDOUT_FILENO               1
+#define STDERR_FILENO               2
+#define PATH_MAX                    MICROPY_PATH_MAX
+#define S_ISREG(m)                  (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m)                  (((m) & S_IFMT) == S_IFDIR)
+
+
+// System headers (needed e.g. for nlr.h)
+
+#include <stddef.h> //for NULL
+#include <assert.h> //for assert
+
+
+// Functions implemented in platform code
+
+int snprintf(char *dest, size_t count, const char *format, ...);
+#endif
diff --git a/windows/msvc/common.props b/windows/msvc/common.props
new file mode 100644
index 0000000000000000000000000000000000000000..300de46a53d9dc329440f6f31cacebc695b61c77
--- /dev/null
+++ b/windows/msvc/common.props
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <OutDir>$(ProjectDir)</OutDir>
+    <IntDir>$(ProjectDir)build\$(Configuration)$(Platform)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>.\;.\build;.\msvc;..\py</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>false</SDLCheck>
+      <WarningLevel>Level1</WarningLevel>
+      <ExceptionHandling>false</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup />
+</Project>
\ No newline at end of file
diff --git a/windows/msvc/debug.props b/windows/msvc/debug.props
new file mode 100644
index 0000000000000000000000000000000000000000..c0a22be8549429663de2b2b855cc3efec8088645
--- /dev/null
+++ b/windows/msvc/debug.props
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup />
+</Project>
diff --git a/windows/msvc/genhdr.targets b/windows/msvc/genhdr.targets
new file mode 100644
index 0000000000000000000000000000000000000000..453d2ff1eb5e2252546c65a1298308427d50b96d
--- /dev/null
+++ b/windows/msvc/genhdr.targets
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GenerateHeaders">
+
+  <Target Name="GenerateHeaders" DependsOnTargets="MakeQstrData;MakeVersionHeader">
+  </Target>
+
+  <PropertyGroup>
+    <SrcDir>$(MsBuildThisFileDirectory)..\..\py\</SrcDir>
+    <DestDir>$(MsBuildThisFileDirectory)..\build\genhdr\</DestDir>
+  </PropertyGroup>
+
+  <Target Name="MakeDestDir">
+    <MakeDir Directories="$(DestDir)"/>
+  </Target>
+
+  <!--don't let regenerating these files trigger builds-->
+  <UsingTask TaskName="MakeSameWriteTime" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
+    <ParameterGroup>
+      <SourceFile Required="true" ParameterType="System.String"/>
+      <DestFile Required="true" ParameterType="System.String"/>
+    </ParameterGroup>
+    <Task>
+      <Code Type="Fragment" Language="cs">
+        <![CDATA[
+        System.IO.File.SetLastWriteTime( DestFile, System.IO.File.GetLastWriteTime( SourceFile ) );
+        ]]>
+      </Code>
+    </Task>
+  </UsingTask>
+
+  <!--see py/py.mk under #qstr data-->
+  <Target Name="MakeQstrData" DependsOnTargets="MakeDestDir">
+    <PropertyGroup>
+      <PreProc>$(DestDir)qstrdefs.preprocessed.h</PreProc>
+      <QstrDefs>$(MsBuildThisFileDirectory)..\..\unix\qstrdefsport.h</QstrDefs>
+      <DestFile>$(DestDir)qstrdefs.generated.h</DestFile>
+    </PropertyGroup>
+    <Exec Command="cl /I$(SrcDir) /I$(MsBuildThisFileDirectory).. /Fi$(PreProc) /P $(SrcDir)qstrdefs.h"/>
+    <Exec Command="python $(SrcDir)makeqstrdata.py $(PreProc) $(QstrDefs) > $(DestFile)"/>
+    <MakeSameWriteTime SourceFile="$(MsBuildThisFile)" DestFile="$(DestFile)"/>
+  </Target>
+
+  <!--see py/py-version.sh-->
+  <Target Name="GetGitState">
+    <Exec Command="git describe --dirty --always" ConsoleToMSBuild="true" IgnoreExitCode="true">
+      <Output TaskParameter="ConsoleOutput" PropertyName="GitTag" />
+    </Exec>
+    <Exec Command="git rev-parse --short HEAD 2>NUL || echo unknown" ConsoleToMSBuild="true" IgnoreExitCode="true">
+      <Output TaskParameter="ConsoleOutput" PropertyName="GitHash" />
+    </Exec>
+    <Exec Command="git diff --no-ext-diff --quiet --exit-code 2>NUL || echo 0" ConsoleToMSBuild="true" IgnoreExitCode="true">
+      <Output TaskParameter="ConsoleOutput" PropertyName="GitFilesAreClean" />
+    </Exec>
+    <Exec Command="git diff-index --cached --quiet HEAD -- 2>NUL || echo 0" ConsoleToMSBuild="true" IgnoreExitCode="true" Condition="'$(GitFilesAreClean)'==''">
+      <Output TaskParameter="ConsoleOutput" PropertyName="GitFilesAreClean" />
+    </Exec>
+  </Target>
+
+  <Target Name="MakeVersionHeader" DependsOnTargets="MakeDestDir;GetGitState">
+    <PropertyGroup Condition="'$(GitFilesAreClean)'=='0'">
+      <GitHash>$(GitHash)-dirty</GitHash>
+    </PropertyGroup>
+    <PropertyGroup>
+      <DestFile>$(DestDir)py-version.h</DestFile>
+    </PropertyGroup>
+    <ItemGroup>
+      <Lines Include="// This file was generated by $([System.IO.Path]::GetFileName(`$(MsBuildThisFile)`))"/>
+      <Lines Include="#define MICROPY_GIT_TAG &quot;$(GitTag)&quot;"/>
+      <Lines Include="#define MICROPY_GIT_HASH &quot;$(GitHash)&quot;"/>
+      <Lines Include="#define MICROPY_BUILD_DATE &quot;$([System.DateTime]::Now.ToString(`yyyy-MM-dd`))&quot;"/>
+    </ItemGroup>
+    <WriteLinesToFile Lines="@(Lines)" File="$(DestFile)" Overwrite="true"/>
+    <MakeSameWriteTime SourceFile="$(MsBuildThisFile)" DestFile="$(DestFile)"/>
+  </Target>
+
+</Project>
diff --git a/windows/msvc/release.props b/windows/msvc/release.props
new file mode 100644
index 0000000000000000000000000000000000000000..ea0bf433d3a183e33bc8677e2036d1b5b71cdb90
--- /dev/null
+++ b/windows/msvc/release.props
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup>
+    <Link>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+    </Link>
+    <ClCompile>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup />
+</Project>
diff --git a/windows/msvc/snprintf.c b/windows/msvc/snprintf.c
new file mode 100644
index 0000000000000000000000000000000000000000..d200a4cbc81a557408ba283be67e9f1acf2d3146
--- /dev/null
+++ b/windows/msvc/snprintf.c
@@ -0,0 +1,44 @@
+/*
+* This file is part of the Micro Python project, http://micropython.org/
+*
+* The MIT License (MIT)
+*
+* Copyright (c) 2013, 2014 Damien P. George
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <malloc.h>
+
+// _snprintf/vsnprintf are fine, except the 'F' specifier is not handled
+int snprintf(char *dest, size_t count, const char *format, ...) {
+    const size_t fmtLen = strlen(format) + 1;
+    char *fixedFmt = alloca(fmtLen);
+    for (size_t i = 0; i < fmtLen; ++i)
+        fixedFmt[i] = format[i] == 'F' ? 'f' : format[i];
+
+    va_list args;
+    va_start(args, format);
+    const int ret = vsnprintf(dest, count, fixedFmt, args);
+    va_end(args);
+
+    return ret;
+}
diff --git a/windows/msvc/sources.props b/windows/msvc/sources.props
new file mode 100644
index 0000000000000000000000000000000000000000..9af7d6e11743de04e84cb5bd62f4acc64e89db0c
--- /dev/null
+++ b/windows/msvc/sources.props
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <PyBaseDir>$(MsbuildThisFileDirectory)..\..\</PyBaseDir>
+  </PropertyGroup>
+  <ItemGroup>
+    <ClCompile Include="$(PyBaseDir)py\*.c" />
+    <ClCompile Include="$(PyBaseDir)unix\*.c" Exclude="$(PyBaseDir)unix\mod*.c" />
+    <ClCompile Include="$(PyBaseDir)windows\*.c" />
+    <ClCompile Include="$(PyBaseDir)windows\msvc\*.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="$(PyBaseDir)py\*.h" />
+    <ClInclude Include="$(PyBaseDir)windows\*.h" />
+    <ClInclude Include="$(PyBaseDir)windows\msvc\*.h" />
+  </ItemGroup>
+</Project>
diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h
new file mode 100644
index 0000000000000000000000000000000000000000..ece86fa749de47f79a61ac449ef7095724d19a13
--- /dev/null
+++ b/windows/msvc/unistd.h
@@ -0,0 +1,28 @@
+/*
+* This file is part of the Micro Python project, http://micropython.org/
+*
+* The MIT License (MIT)
+*
+* Copyright (c) 2013, 2014 Damien P. George
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+// There's no unistd.h, but this is the equivalent
+#include <io.h>