Fixes compatibility with Borland C++Builder. Original patch by Josh

Kelley.  Simplified by Zhanyong Wan.
This commit is contained in:
zhanyong.wan
2011-03-05 08:04:01 +00:00
parent 66ac4909ae
commit 603533a0a4
6 changed files with 51 additions and 15 deletions

View File

@@ -873,6 +873,11 @@ class ImplicitlyConvertible {
static const bool value =
sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
# pragma warning(pop) // Restores the warning state.
#elif defined(__BORLANDC__)
// C++Builder cannot use member overload resolution during template
// instantiation. The simplest workaround is to use its C++0x type traits
// functions (C++Builder 2009 and above only).
static const bool value = __is_convertible(From, To);
#else
static const bool value =
sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;

View File

@@ -296,7 +296,7 @@ class GTEST_API_ String {
private:
// Constructs a non-NULL String from the given content. This
// function can only be called when data_ has not been allocated.
// function can only be called when c_str_ has not been allocated.
// ConstructNonNull(NULL, 0) results in an empty string ("").
// ConstructNonNull(NULL, non_zero) is undefined behavior.
void ConstructNonNull(const char* buffer, size_t a_length) {