Refactor create_nan() for Windows