Fix cling compilation errors on Windows (with VS 2015)

This commit is contained in:
Bertrand Bellenot 2016-02-23 09:24:23 +01:00 committed by sftnight
parent c1cb2ca6f2
commit 2649f0d318
4 changed files with 13 additions and 1 deletions

View File

@ -89,7 +89,7 @@ string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# The package needs to be compiler without RTTI information
if(MSVC)
add_definitions(/GR-)
add_definitions(/GR- /DNOMINMAX)
else()
add_definitions(-fno-rtti)
endif()

View File

@ -13,6 +13,8 @@
#include <assert.h>
#include <errno.h>
#ifdef LLVM_ON_WIN32
# define WIN32_LEAN_AND_MEAN
# define NOGDI
# include <Windows.h>
#else
# include <unistd.h>

View File

@ -89,7 +89,11 @@ namespace {
#endif
#ifdef _MSC_VER
HKEY regVS;
#if (_MSC_VER >= 1900)
int VSVersion = (_MSC_VER / 100) - 5;
#else
int VSVersion = (_MSC_VER / 100) - 6;
#endif
std::stringstream subKey;
subKey << "VisualStudio.DTE." << VSVersion << ".0";
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, subKey.str().c_str(), 0, KEY_READ, &regVS) == ERROR_SUCCESS) {

View File

@ -20,6 +20,12 @@
#include <string>
#include <cstring>
#include <unistd.h>
#ifndef _MSC_VER
# include <unistd.h>
#else
# include <io.h>
# define write _write
#endif
// FIXME: should be moved into a Jupyter interp struct that then gets returned
// from create.