[Mono-dev] Building mono runtime in VS2003

Brock Reeve Brock.Reeve at ni.com
Wed Dec 12 17:14:55 EST 2007

Ok. I did something very similiar. The only difference appears to be the 
_ReadBarrier. _ReadBarrier appears to work (it compiles and links). I 
haven't tried it at runtime yet. Does it not work at runtime?

#if _MSC_VER < 1400 //VS2003
        extern void _ReadWriteBarrier();
    extern void _ReadBarrier();
    extern void _WriteBarrier();

        #pragma intrinsic(_ReadWriteBarrier)
        #pragma intrinsic(_WriteBarrier)

        #include <intrin.h>
        static inline void mono_memory_barrier (void)
                _ReadWriteBarrier ();

        static inline void mono_memory_read_barrier (void)
                _ReadBarrier ();

        static inline void mono_memory_write_barrier (void)
                _WriteBarrier ();

"Aras Pranckevicius" <aras at unity3d.com> 
Sent by: mono-devel-list-bounces at lists.ximian.com
12/12/2007 03:55 PM

mono-devel-list at lists.ximian.com

Re: [Mono-dev] Building mono runtime in VS2003

> I have worked through most issues (eglib and libgc are
> building) but one has got me. In mono-membar.h (libmono) it is looking 
> intrin.h which does not ship with VS2003.

Here's what we do:

    #if _MSC_VER >= 1400
    #include <intrin.h> /* VS2005 */
    void _ReadWriteBarrier();
    #pragma intrinsic(_ReadWriteBarrier)
    void _WriteBarrier();
    #pragma intrinsic(_WriteBarrier)

And then change mono_memory_read_barrier to:
    #if _MSC_VER >= 1400
    _ReadBarrier ();
    _ReadWriteBarrier(); /* VS2003 does not have _ReadBarrier intrinsic */

VS2003 does not seem to have ReadBarrier, so instead do a full
read&write barrier. Which can be a bit more expensive, but oh well.

Aras Pranckevicius
work: http://unity3d.com
home: http://aras-p.info
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071212/0b3c0216/attachment.html 

More information about the Mono-devel-list mailing list