Fix compilation when fileno is a macro

This can happen on broken versions of MinGW.
This commit is contained in:
vitaut 2015-05-06 07:19:42 -07:00
parent 11464343a9
commit ca2cadb1c6

View File

@ -177,7 +177,11 @@ int test::fclose(FILE *stream) {
int (test::fileno)(FILE *stream) {
EMULATE_EINTR(fileno, -1);
#ifdef fileno
return FMT_POSIX(fileno(stream));
#else
return ::FMT_POSIX(fileno(stream));
#endif
}
#ifndef _WIN32
@ -433,7 +437,7 @@ TEST(BufferedFileTest, FilenoNoRetry) {
File::pipe(read_end, write_end);
BufferedFile f = read_end.fdopen("r");
fileno_count = 1;
EXPECT_SYSTEM_ERROR(f.fileno(), EINTR, "cannot get file descriptor");
EXPECT_SYSTEM_ERROR((f.fileno)(), EINTR, "cannot get file descriptor");
EXPECT_EQ(2, fileno_count);
fileno_count = 0;
}