fix build issue on platform where fileno is a naive macro