[Mono-dev] Building mono runtime in VS2003

Aras Pranckevicius aras at unity3d.com
Wed Dec 12 16:55:47 EST 2007


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

Here's what we do:

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

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

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



More information about the Mono-devel-list mailing list