mirror of
https://github.com/fmtlib/fmt.git
synced 2025-04-16 05:42:19 +00:00
Fix compilation when fileno is a macro
This can happen on broken versions of MinGW.
This commit is contained in:
parent
11464343a9
commit
ca2cadb1c6
@ -177,7 +177,11 @@ int test::fclose(FILE *stream) {
|
|||||||
|
|
||||||
int (test::fileno)(FILE *stream) {
|
int (test::fileno)(FILE *stream) {
|
||||||
EMULATE_EINTR(fileno, -1);
|
EMULATE_EINTR(fileno, -1);
|
||||||
|
#ifdef fileno
|
||||||
|
return FMT_POSIX(fileno(stream));
|
||||||
|
#else
|
||||||
return ::FMT_POSIX(fileno(stream));
|
return ::FMT_POSIX(fileno(stream));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
@ -433,7 +437,7 @@ TEST(BufferedFileTest, FilenoNoRetry) {
|
|||||||
File::pipe(read_end, write_end);
|
File::pipe(read_end, write_end);
|
||||||
BufferedFile f = read_end.fdopen("r");
|
BufferedFile f = read_end.fdopen("r");
|
||||||
fileno_count = 1;
|
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);
|
EXPECT_EQ(2, fileno_count);
|
||||||
fileno_count = 0;
|
fileno_count = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user