JuliaLang/julia — pull request #5022 by tknopp (2013-12-03 16:43:45+00:00)
Title: RFC: Make Libjulia compile in Windows with Intel Compiler

This is some work to make libjulia compile on windows with the intel compiler. There are already some make scripts (Windows.mk) in the julia source tree but it required some work to get it compile.

Some of the things are also a step forward to compile libjulia with MSVC.

Changes:
- __uint128_t is not defined in non-gcc environment
- There were some places where dynamically stack allocated C arrays were used (i.e. ccall.cpp:750). But these are not available in C++. I have changed these to use std::vector.
- uv_err_t seems to be a struct with a member code and is not convertible to an int (why does gcc/clang take this?)
- There was an issue with WINBOOL WINAPI. I have simply changed this to BOOL. This needs to be verified by someone how uses Mingw, if this is still ok.
- In dtypes.h the header platform.h has to be included first as otherwise, the define _OS_WINDOWS_ is not available
- When including LLVM headers one has to define #define NOMINMAX as otherwise std::max is shadowed by a windows macro for max

It would be great if someone could review this and commit if it is fine.

There are still some issues left as my self-written program that uses libjulia crashes when trying to either build Base or use an exsisting sys.jl but I think this is the next step and want to first get this in.

One last comment on MSVC: With VS2010 there is an issue: It basically only allows C89. Solutions:
a) Forget about VS2010 and try VS2013 which should have basic C99 support
b) Put all declarations at the beginnings of each block (oh my god)
c) Compile with MSVC C++ compiler. This would mean that we have to introduce casts when assigning pointers of different type (i.e. jl_value_t* x = (jl_value_t*) JL_NULL)