Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
ce61dc54
Unverified
Commit
ce61dc54
authored
Feb 27, 2018
by
Gennadiy Civil
Committed by
GitHub
Feb 27, 2018
Browse files
Merge pull request #1423 from pcc/win-libcxx2
Use _CPPUNWIND instead of _HAS_EXCEPTIONS with MSVC.
parents
7d15497f
d4f77c1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
googletest/cmake/internal_utils.cmake
googletest/cmake/internal_utils.cmake
+1
-1
googletest/include/gtest/internal/gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+5
-2
No files found.
googletest/cmake/internal_utils.cmake
View file @
ce61dc54
...
...
@@ -91,7 +91,7 @@ macro(config_compiler_and_linker)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-D_UNICODE -DUNICODE -DWIN32 -D_WIN32"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-DSTRICT -DWIN32_LEAN_AND_MEAN"
)
set
(
cxx_exception_flags
"-EHsc -D_HAS_EXCEPTIONS=1"
)
set
(
cxx_no_exception_flags
"-D_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_exception_flags
"
-EHs-c-
-D_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_rtti_flags
"-GR-"
)
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
cxx_base_flags
"-Wall -Wshadow -Werror"
)
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
ce61dc54
...
...
@@ -471,8 +471,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#ifndef GTEST_HAS_EXCEPTIONS
// The user didn't tell us whether exceptions are enabled, so we need
// to figure it out.
# if defined(_MSC_VER) || defined(__BORLANDC__)
// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
# if defined(_MSC_VER) && defined(_CPPUNWIND)
// MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.
# define GTEST_HAS_EXCEPTIONS 1
# elif defined(__BORLANDC__)
// C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
// macro to enable exceptions, so we'll do the same.
// Assumes that exceptions are enabled by default.
# ifndef _HAS_EXCEPTIONS
...
...
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