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
5017fe00
Commit
5017fe00
authored
Mar 11, 2011
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes compatibility with Sun C++ (by Hady Zalek); fixes compatibility
with Android (by Zachary Vorhies).
parent
5451ffe8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
gtest-internal.h
include/gtest/internal/gtest-internal.h
+6
-6
gtest-port.h
include/gtest/internal/gtest-port.h
+8
-2
gtest.cc
src/gtest.cc
+3
-3
No files found.
include/gtest/internal/gtest-internal.h
View file @
5017fe00
...
@@ -788,16 +788,16 @@ struct RemoveConst { typedef T type; }; // NOLINT
...
@@ -788,16 +788,16 @@ struct RemoveConst { typedef T type; }; // NOLINT
template
<
typename
T
>
template
<
typename
T
>
struct
RemoveConst
<
const
T
>
{
typedef
T
type
;
};
// NOLINT
struct
RemoveConst
<
const
T
>
{
typedef
T
type
;
};
// NOLINT
// MSVC 8.0
has a bug which causes the above definition to fail to
// MSVC 8.0
and Sun C++ have a bug which causes the above definition
//
remove the const in 'const int[3]'. The following specialization
//
to fail to remove the const in 'const int[3]'. The following
//
works around the bug. However, it causes trouble with gcc and thus
//
specialization works around the bug. However, it causes trouble
// needs to be conditionally compiled.
//
with GCC and thus
needs to be conditionally compiled.
#if
def _MSC_VER
#if
defined(_MSC_VER) || defined(__SUNPRO_CC)
template
<
typename
T
,
size_t
N
>
template
<
typename
T
,
size_t
N
>
struct
RemoveConst
<
T
[
N
]
>
{
struct
RemoveConst
<
T
[
N
]
>
{
typedef
typename
RemoveConst
<
T
>::
type
type
[
N
];
typedef
typename
RemoveConst
<
T
>::
type
type
[
N
];
};
};
#endif
// _MSC_VER
#endif
// A handy wrapper around RemoveConst that works when the argument
// A handy wrapper around RemoveConst that works when the argument
// T depends on template parameters.
// T depends on template parameters.
...
...
include/gtest/internal/gtest-port.h
View file @
5017fe00
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
// GTEST_OS_AIX - IBM AIX
// GTEST_OS_AIX - IBM AIX
// GTEST_OS_CYGWIN - Cygwin
// GTEST_OS_CYGWIN - Cygwin
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX_ANDROID - Google Android
// GTEST_OS_MAC - Mac OS X
// GTEST_OS_MAC - Mac OS X
// GTEST_OS_NACL - Google Native Client (NaCl)
// GTEST_OS_NACL - Google Native Client (NaCl)
// GTEST_OS_SOLARIS - Sun Solaris
// GTEST_OS_SOLARIS - Sun Solaris
...
@@ -225,6 +226,9 @@
...
@@ -225,6 +226,9 @@
# define GTEST_OS_MAC 1
# define GTEST_OS_MAC 1
#elif defined __linux__
#elif defined __linux__
# define GTEST_OS_LINUX 1
# define GTEST_OS_LINUX 1
# ifdef ANDROID
# define GTEST_OS_LINUX_ANDROID 1
# endif // ANDROID
#elif defined __MVS__
#elif defined __MVS__
# define GTEST_OS_ZOS 1
# define GTEST_OS_ZOS 1
#elif defined(__sun) && defined(__SVR4)
#elif defined(__sun) && defined(__SVR4)
...
@@ -336,8 +340,10 @@
...
@@ -336,8 +340,10 @@
// is available.
// is available.
// Cygwin 1.7 and below doesn't support ::std::wstring.
// Cygwin 1.7 and below doesn't support ::std::wstring.
// Solaris' libc++ doesn't support it either.
// Solaris' libc++ doesn't support it either. Android has
# define GTEST_HAS_STD_WSTRING (!(GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
// no support for it at least as recent as Froyo (2.2).
# define GTEST_HAS_STD_WSTRING \
(!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
#endif // GTEST_HAS_STD_WSTRING
#endif // GTEST_HAS_STD_WSTRING
...
...
src/gtest.cc
View file @
5017fe00
...
@@ -1621,11 +1621,11 @@ bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
...
@@ -1621,11 +1621,11 @@ bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
#if GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
return
_wcsicmp
(
lhs
,
rhs
)
==
0
;
return
_wcsicmp
(
lhs
,
rhs
)
==
0
;
#elif GTEST_OS_LINUX
#elif GTEST_OS_LINUX
&& !GTEST_OS_LINUX_ANDROID
return
wcscasecmp
(
lhs
,
rhs
)
==
0
;
return
wcscasecmp
(
lhs
,
rhs
)
==
0
;
#else
#else
//
Mac OS X and Cygwin don't define wcscasecmp. Other unknown OSes
//
Android, Mac OS X and Cygwin don't define wcscasecmp.
// may not define it either.
//
Other unknown OSes
may not define it either.
wint_t
left
,
right
;
wint_t
left
,
right
;
do
{
do
{
left
=
towlower
(
*
lhs
++
);
left
=
towlower
(
*
lhs
++
);
...
...
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