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
6a26383e
Commit
6a26383e
authored
Mar 31, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleans up the use of GTEST_OS_WINDOWS and _MSC_VER.
parent
3e54f5a3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
24 deletions
+13
-24
gtest.h
include/gtest/gtest.h
+1
-8
gtest-port.h
include/gtest/internal/gtest-port.h
+2
-6
gtest-port.cc
src/gtest-port.cc
+3
-3
gtest.cc
src/gtest.cc
+3
-3
gtest_unittest.cc
test/gtest_unittest.cc
+4
-4
No files found.
include/gtest/gtest.h
View file @
6a26383e
...
@@ -51,15 +51,8 @@
...
@@ -51,15 +51,8 @@
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_H_
// The following platform macro
s are
used throughout Google Test:
// The following platform macro
is
used throughout Google Test:
// _WIN32_WCE Windows CE (set in project files)
// _WIN32_WCE Windows CE (set in project files)
//
// Note that even though _MSC_VER and _WIN32_WCE really indicate a compiler
// and a Win32 implementation, respectively, we use them to indicate the
// combination of compiler - Win 32 API - C library, since the code currently
// only supports:
// Windows proper with Visual C++ and MS C library (_MSC_VER && !_WIN32_WCE) and
// Windows Mobile with Visual C++ and no C library (_WIN32_WCE).
#include <limits>
#include <limits>
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-internal.h>
...
...
include/gtest/internal/gtest-port.h
View file @
6a26383e
...
@@ -172,11 +172,7 @@
...
@@ -172,11 +172,7 @@
#define GTEST_OS_CYGWIN 1
#define GTEST_OS_CYGWIN 1
#elif __SYMBIAN32__
#elif __SYMBIAN32__
#define GTEST_OS_SYMBIAN 1
#define GTEST_OS_SYMBIAN 1
#elif defined _MSC_VER
#elif defined _WIN32
// TODO(kenton@google.com): GTEST_OS_WINDOWS is currently used to mean
// both "The OS is Windows" and "The compiler is MSVC". These
// meanings really should be separated in order to better support
// Windows compilers other than MSVC.
#define GTEST_OS_WINDOWS 1
#define GTEST_OS_WINDOWS 1
#elif defined __APPLE__
#elif defined __APPLE__
#define GTEST_OS_MAC 1
#define GTEST_OS_MAC 1
...
@@ -186,7 +182,7 @@
...
@@ -186,7 +182,7 @@
#define GTEST_OS_ZOS 1
#define GTEST_OS_ZOS 1
#elif defined(__sun) && defined(__SVR4)
#elif defined(__sun) && defined(__SVR4)
#define GTEST_OS_SOLARIS 1
#define GTEST_OS_SOLARIS 1
#endif // _
MSC_VER
#endif // _
_CYGWIN__
#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
...
...
src/gtest-port.cc
View file @
6a26383e
...
@@ -62,12 +62,12 @@
...
@@ -62,12 +62,12 @@
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
#if
GTEST_OS_WINDOWS
#if
def _MSC_VER
// M
icrosoft
does not provide a definition of STDERR_FILENO.
// M
SVC
does not provide a definition of STDERR_FILENO.
const
int
kStdErrFileno
=
2
;
const
int
kStdErrFileno
=
2
;
#else
#else
const
int
kStdErrFileno
=
STDERR_FILENO
;
const
int
kStdErrFileno
=
STDERR_FILENO
;
#endif //
GTEST_OS_WINDOWS
#endif //
_MSC_VER
#if GTEST_USES_POSIX_RE
#if GTEST_USES_POSIX_RE
...
...
src/gtest.cc
View file @
6a26383e
...
@@ -1710,16 +1710,16 @@ String String::Format(const char * format, ...) {
...
@@ -1710,16 +1710,16 @@ String String::Format(const char * format, ...) {
char
buffer
[
4096
];
char
buffer
[
4096
];
// MSVC 8 deprecates vsnprintf(), so we want to suppress warning
// MSVC 8 deprecates vsnprintf(), so we want to suppress warning
// 4996 (deprecated function) there.
// 4996 (deprecated function) there.
#if
GTEST_OS_WINDOWS // We are on Windows
.
#if
def _MSC_VER // We are using MSVC
.
#pragma warning(push) // Saves the current warning state.
#pragma warning(push) // Saves the current warning state.
#pragma warning(disable:4996) // Temporarily disables warning 4996.
#pragma warning(disable:4996) // Temporarily disables warning 4996.
const
int
size
=
const
int
size
=
vsnprintf
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
])
-
1
,
format
,
args
);
vsnprintf
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
])
-
1
,
format
,
args
);
#pragma warning(pop) // Restores the warning state.
#pragma warning(pop) // Restores the warning state.
#else // We are
on Linux or Mac OS
.
#else // We are
not using MSVC
.
const
int
size
=
const
int
size
=
vsnprintf
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
])
-
1
,
format
,
args
);
vsnprintf
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
])
-
1
,
format
,
args
);
#endif //
GTEST_OS_WINDOWS
#endif //
_MSC_VER
va_end
(
args
);
va_end
(
args
);
return
String
(
size
>=
0
?
buffer
:
"<buffer exceeded>"
);
return
String
(
size
>=
0
?
buffer
:
"<buffer exceeded>"
);
...
...
test/gtest_unittest.cc
View file @
6a26383e
...
@@ -3148,9 +3148,9 @@ TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
...
@@ -3148,9 +3148,9 @@ TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
// The version of gcc used in XCode 2.2 has a bug and doesn't allow
// The version of gcc used in XCode 2.2 has a bug and doesn't allow
// anonymous enums in assertions. Therefore the following test is
// anonymous enums in assertions. Therefore the following test is
not
// done on
ly on Linux and Windows
.
// done on
Mac
.
#if
GTEST_OS_LINUX || GTEST_OS_WINDOWS
#if
!GTEST_OS_MAC
// Tests using assertions with anonymous enums.
// Tests using assertions with anonymous enums.
enum
{
enum
{
...
@@ -3195,7 +3195,7 @@ TEST(AssertionTest, AnonymousEnum) {
...
@@ -3195,7 +3195,7 @@ TEST(AssertionTest, AnonymousEnum) {
"Value of: CASE_B"
);
"Value of: CASE_B"
);
}
}
#endif //
GTEST_OS_LINUX || GTEST_OS_WINDOWS
#endif //
!GTEST_OS_MAC
#if GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
...
...
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