Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
dbe804f9
Commit
dbe804f9
authored
Mar 20, 2020
by
vslashg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2746 from Romain-Geissler-1A:master
PiperOrigin-RevId: 302045808
parents
482ac6ee
a1b0173d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+18
-5
No files found.
googletest/include/gtest/internal/gtest-port.h
View file @
dbe804f9
...
...
@@ -252,6 +252,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cerrno>
#include <cstdint>
#include <limits>
#include <type_traits>
...
...
@@ -1960,16 +1962,16 @@ namespace posix {
typedef
struct
_stat
StatStruct
;
# ifdef __BORLANDC__
inline
int
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
Do
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
StrCaseCmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
stricmp
(
s1
,
s2
);
}
inline
char
*
StrDup
(
const
char
*
src
)
{
return
strdup
(
src
);
}
# else // !__BORLANDC__
# if GTEST_OS_WINDOWS_MOBILE
inline
int
IsATTY
(
int
/* fd */
)
{
return
0
;
}
inline
int
Do
IsATTY
(
int
/* fd */
)
{
return
0
;
}
# else
inline
int
IsATTY
(
int
fd
)
{
return
_isatty
(
fd
);
}
inline
int
Do
IsATTY
(
int
fd
)
{
return
_isatty
(
fd
);
}
# endif // GTEST_OS_WINDOWS_MOBILE
inline
int
StrCaseCmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
_stricmp
(
s1
,
s2
);
...
...
@@ -1994,7 +1996,7 @@ inline bool IsDir(const StatStruct& st) {
typedef
struct
stat
StatStruct
;
inline
int
FileNo
(
FILE
*
file
)
{
return
fileno
(
file
);
}
inline
int
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
Do
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
Stat
(
const
char
*
path
,
StatStruct
*
buf
)
{
// stat function not implemented on ESP8266
return
0
;
...
...
@@ -2011,7 +2013,7 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
typedef
struct
stat
StatStruct
;
inline
int
FileNo
(
FILE
*
file
)
{
return
fileno
(
file
);
}
inline
int
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
Do
IsATTY
(
int
fd
)
{
return
isatty
(
fd
);
}
inline
int
Stat
(
const
char
*
path
,
StatStruct
*
buf
)
{
return
stat
(
path
,
buf
);
}
inline
int
StrCaseCmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
strcasecmp
(
s1
,
s2
);
...
...
@@ -2022,6 +2024,17 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
#endif // GTEST_OS_WINDOWS
inline
int
IsATTY
(
int
fd
)
{
// DoIsATTY might change errno (for example ENOTTY in case you redirect stdout
// to a file on Linux), which is unexpected, so save the previous value, and
// restore it after the call.
int
savedErrno
=
errno
;
int
isAttyValue
=
DoIsATTY
(
fd
);
errno
=
savedErrno
;
return
isAttyValue
;
}
// Functions deprecated by MSVC 8.0.
GTEST_DISABLE_MSC_DEPRECATED_PUSH_
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment