Solve Windows&Linux build error

Append OS condition to avoid build error.