Adapt code to MS VC++ compiler