[Mono-devel-list] [PATCH] Changes required to compile Mono HEAD with Visual Studio.NET 2005

Sebastien Pouliot sebastien at ximian.com
Fri Mar 11 12:49:07 EST 2005


Hello everyone,

Here's an updated patch to make mono HEAD compilable with VS.NET 2005
(and probably earlier versions too). Please note that most of the
changes are from the previous work of J Lothian. Thanks again!

There is no project/solution files attached as I still have to clean
them from system (mine) specific paths... and reorganize it to avoid
some warnings. With a little luck it will be possible to add them in SVN
alter without requiring much custom editing.

The changes do not seems to affect compilation/results of Mono under
cygwin or Linux. However I do not know if this affects compilation under
mingw. Anyone using mingw to compile Mono ?


*** Main issues ***

[1]	__builtin_frame_address(1) is a lot more complex to implement
	than __builtin_frame_address(0)

        This means that some samples (like the embedded samples) don't
        work but (hapilly ;-) I'm able to do the security stack walk
        (because they do not requires (1)).

        My last attempt to fix that (using naked functions) failed :-(.
        I will give it another try this weekend.

[2]	MS C (Microsoft C compiler) doesn't like empty enums. We got one
	like that in mini-x86.c.


Here is a description of the changes...

/mono/io-layer/

* io-layer.h
        Include <winsock2.h> before <windows.h>. Added missing includes
        required by MSC.


/mono/mono/metadata/

* appdomain.c
	Type casting to LPTHREAD_START_ROUTINE in CreateThread

* appdomain.h
        Changed inline to MONO_INLINE as MSC doesn't like this case of
        inlining

* assembly.c
	add include for "msc.h" (for MONO_ASSEMBLIES)

* domain.c
        Removed inline from functions (they are already inline in
        appdomain.h) because they cause link errors with MSC

* threads.c
	Add required typecast.
	MSC similar to MINGW32

* sysmath.h
	include "msc.h" when compiled with MSC

* rawbuffer.c
	include <winsock2.h> before <windows.h>

* rand.c
	include <windows.h> before <WinCrypt.h>
	removed warning (missing typecast)


/mono/mono/mini/

aot.c
* include <winsock2.h> before <windows.h>

mini.h
* include "mono/metadata/msc.h" (new file) when compiled with MSC

mini-exceptions.c
* replace usage of __builtin_frame_address and __builtin_return_address
(GCC) with MSC "equivalent"
	!!! See issue [1]

mini-x86.c
* MSC doesn't like empty enum vector;
	!!! not sure if this is ok !!! see [2]
* changed to inline assembly to MSC format

mini-x86.h
* MSC doesn't like empty struct


/mono/os/

gc_wrapper.h
        Include <winsock2.h> before including anything else (<windows.h>
        in particular) from gc.


-- 
Sebastien Pouliot  <sebastien at ximian.com>
blog: http://pages.infinit.net/ctech/poupou.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono.vstudio.20050311.diff
Type: text/x-patch
Size: 14628 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050311/04277f79/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msc.h
Type: text/x-chdr
Size: 386 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050311/04277f79/attachment-0001.bin 


More information about the Mono-devel-list mailing list