Skip to content

Commit af463c4

Browse files
committed
More merges, removing old dead code
1 parent cf9d634 commit af463c4

File tree

4 files changed

+14
-72
lines changed

4 files changed

+14
-72
lines changed

googlemock/include/gmock/gmock-actions.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
#include "gmock/internal/gmock-internal-utils.h"
4747
#include "gmock/internal/gmock-port.h"
4848

49-
#if GTEST_HAS_STD_TYPE_TRAITS_ // Defined by gtest-port.h via gmock-port.h.
49+
#if GTEST_LANG_CXX11 // Defined by gtest-port.h via gmock-port.h.
50+
#include <functional>
5051
#include <type_traits>
51-
#endif
52+
#endif // GTEST_LANG_CXX11
5253

5354
namespace testing {
5455

@@ -96,7 +97,7 @@ struct BuiltInDefaultValueGetter<T, false> {
9697
template <typename T>
9798
class BuiltInDefaultValue {
9899
public:
99-
#if GTEST_HAS_STD_TYPE_TRAITS_
100+
#if GTEST_LANG_CXX11
100101
// This function returns true iff type T has a built-in default value.
101102
static bool Exists() {
102103
return ::std::is_default_constructible<T>::value;
@@ -107,7 +108,7 @@ class BuiltInDefaultValue {
107108
T, ::std::is_default_constructible<T>::value>::Get();
108109
}
109110

110-
#else // GTEST_HAS_STD_TYPE_TRAITS_
111+
#else // GTEST_LANG_CXX11
111112
// This function returns true iff type T has a built-in default value.
112113
static bool Exists() {
113114
return false;
@@ -117,7 +118,7 @@ class BuiltInDefaultValue {
117118
return BuiltInDefaultValueGetter<T, false>::Get();
118119
}
119120

120-
#endif // GTEST_HAS_STD_TYPE_TRAITS_
121+
#endif // GTEST_LANG_CXX11
121122
};
122123

123124
// This partial specialization says that we use the same built-in

googlemock/test/gmock-actions_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class MyNonDefaultConstructible {
218218
int value_;
219219
};
220220

221-
#if GTEST_HAS_STD_TYPE_TRAITS_
221+
#if GTEST_LANG_CXX11
222222

223223
TEST(BuiltInDefaultValueTest, ExistsForDefaultConstructibleType) {
224224
EXPECT_TRUE(BuiltInDefaultValue<MyDefaultConstructible>::Exists());
@@ -228,7 +228,7 @@ TEST(BuiltInDefaultValueTest, IsDefaultConstructedForDefaultConstructibleType) {
228228
EXPECT_EQ(42, BuiltInDefaultValue<MyDefaultConstructible>::Get().value());
229229
}
230230

231-
#endif // GTEST_HAS_STD_TYPE_TRAITS_
231+
#endif // GTEST_LANG_CXX11
232232

233233
TEST(BuiltInDefaultValueTest, DoesNotExistForNonDefaultConstructibleType) {
234234
EXPECT_FALSE(BuiltInDefaultValue<MyNonDefaultConstructible>::Exists());

googletest/include/gtest/internal/gtest-port.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,14 @@
363363
#if GTEST_STDLIB_CXX11
364364
# define GTEST_HAS_STD_BEGIN_AND_END_ 1
365365
# define GTEST_HAS_STD_FORWARD_LIST_ 1
366-
# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824) // works only with VS2015U2 and better
366+
# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)
367+
// works only with VS2015U2 and better
367368
# define GTEST_HAS_STD_FUNCTION_ 1
368369
# endif
369370
# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
370371
# define GTEST_HAS_STD_MOVE_ 1
371-
# define GTEST_HAS_STD_SHARED_PTR_ 1
372-
# define GTEST_HAS_STD_TYPE_TRAITS_ 1
373372
# define GTEST_HAS_STD_UNIQUE_PTR_ 1
374-
# define GTEST_HAS_UNORDERED_MAP_ 1
375-
# define GTEST_HAS_UNORDERED_SET_ 1
373+
# define GTEST_HAS_STD_SHARED_PTR_ 1
376374
#endif
377375

378376
// C++11 specifies that <tuple> provides std::tuple.
@@ -982,13 +980,13 @@ using ::std::tuple_size;
982980
# endif
983981
#elif __GNUC__ >= 4 || defined(__clang__)
984982
# define GTEST_API_ __attribute__((visibility ("default")))
985-
#endif // _MSC_VER
983+
#endif // _MSC_VER
986984

987-
#endif // GTEST_API_
985+
#endif // GTEST_API_
988986

989987
#ifndef GTEST_API_
990988
# define GTEST_API_
991-
#endif // GTEST_API_
989+
#endif // GTEST_API_
992990

993991
#ifndef GTEST_DEFAULT_DEATH_TEST_STYLE
994992
# define GTEST_DEFAULT_DEATH_TEST_STYLE "fast"

googletest/test/gtest-printers_test.cc

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@
5050

5151
#include "gtest/gtest.h"
5252

53-
// hash_map and hash_set are available under Visual C++, or on Linux.
54-
#if GTEST_HAS_UNORDERED_MAP_
55-
# include <unordered_map> // NOLINT
56-
#elif GTEST_HAS_HASH_MAP_
57-
# include <hash_map> // NOLINT
58-
#endif // GTEST_HAS_HASH_MAP_
59-
60-
#if GTEST_HAS_UNORDERED_SET_
61-
# include <unordered_set> // NOLINT
62-
#elif GTEST_HAS_HASH_SET_
63-
# include <hash_set> // NOLINT
64-
#endif // GTEST_HAS_HASH_SET_
65-
6653
#if GTEST_HAS_STD_FORWARD_LIST_
6754
# include <forward_list> // NOLINT
6855
#endif // GTEST_HAS_STD_FORWARD_LIST_
@@ -240,50 +227,6 @@ using ::testing::internal::UniversalTersePrint;
240227
using ::testing::internal::UniversalTersePrintTupleFieldsToStrings;
241228
#endif
242229

243-
244-
// The hash_* classes are not part of the C++ standard. STLport
245-
// defines them in namespace std. MSVC defines them in ::stdext. GCC
246-
// defines them in ::.
247-
#if GTEST_HAS_UNORDERED_MAP_
248-
249-
#define GTEST_HAS_HASH_MAP_ 1
250-
template <class Key, class T>
251-
using hash_map = ::std::unordered_map<Key, T>;
252-
template <class Key, class T>
253-
using hash_multimap = ::std::unordered_multimap<Key, T>;
254-
255-
#elif GTEST_HAS_HASH_MAP_
256-
257-
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
258-
using ::std::hash_map;
259-
using ::std::hash_multimap;
260-
#elif _MSC_VER
261-
using ::stdext::hash_map;
262-
using ::stdext::hash_multimap;
263-
#endif
264-
265-
#endif
266-
267-
#if GTEST_HAS_UNORDERED_SET_
268-
269-
#define GTEST_HAS_HASH_SET_ 1
270-
template <class Key>
271-
using hash_set = ::std::unordered_set<Key>;
272-
template <class Key>
273-
using hash_multiset = ::std::unordered_multiset<Key>;
274-
275-
#elif GTEST_HAS_HASH_SET_
276-
277-
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
278-
using ::std::hash_map;
279-
using ::std::hash_multimap;
280-
#elif _MSC_VER
281-
using ::stdext::hash_map;
282-
using ::stdext::hash_multimap;
283-
#endif
284-
285-
#endif
286-
287230
// Prints a value to a string using the universal value printer. This
288231
// is a helper for testing UniversalPrinter<T>::Print() for various types.
289232
template <typename T>

0 commit comments

Comments
 (0)