ANSI C and win c compiler fixes