workaround for VS2010/VS2012 codegen bug

Does this need a bug entry?