On 14 авг, 02:24, Kenton Varda <ken...@google.com> wrote:
> Please send a patch. Use "diff -u" to create it (see the man page), or if
> you made your changes against the SVN sources, just use "svn diff".
>
I also get worket MSVC 7.1 in this pathes (note on macro EXPECT_EQ
produse Internal Compiller error on MSVC 7.1, if std::string passed
without const).
1) vsprojects\config.h
--- c:\_ps2008\protobuf\protobuf-2.2.0\vsprojects\config.h Wed Aug 12
07:25:20 2009
+++ c:\lib\protobuf_ps\vsprojects\config.h Thu Aug 13 17:22:42 2009
@@ -5,7 +5,7 @@
#define HASH_MAP_H <hash_map>
/* the namespace of hash_map/hash_set */
-#if _MSC_VER < 1310
+#if (_MSC_VER < 1310) || defined(_STLPORT_VERSION)
#define HASH_NAMESPACE std
#else
#define HASH_NAMESPACE stdext
2) gtest/*
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\gtest\include\gtest\internal\gtest-
port.h c:\lib\protobuf_ps\gtest\include\gtest\internal\gtest-port.h
--- c:\_ps2008\protobuf\protobuf-2.2.0\gtest\include\gtest\internal
\gtest-port.h Wed Aug 12 07:25:26 2009
+++ c:\lib\protobuf_ps\gtest\include\gtest\internal\gtest-port.h Thu
Aug 13 17:22:46 2009
@@ -79,6 +79,7 @@
// GTEST_OS_SYMBIAN - Symbian
// GTEST_OS_WINDOWS - Windows
// GTEST_OS_ZOS - z/OS
+// GTEST_OS_HPUX - HPUX PA-RISC/ia64
//
// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
// most stable support. Since core members of the Google Test
project
@@ -192,10 +193,18 @@
#define GTEST_OS_ZOS 1
#elif defined(__sun) && defined(__SVR4)
#define GTEST_OS_SOLARIS 1
+#elif defined (__hpux)
+#define GTEST_OS_HPUX 1
#endif // __CYGWIN__
+#if GTEST_OS_HPUX
+#define _INCLUDE__STDC_A1_SOURCE
+#define _INCLUDE_HPUX_SOURCE
+#include <wchar.h> // NOLINT
+#endif
+
#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC ||
GTEST_OS_SYMBIAN || \
- GTEST_OS_SOLARIS
+ GTEST_OS_SOLARIS || GTEST_OS_HPUX
// On some platforms, <regex.h> needs someone to define size_t, and
// won't compile otherwise. We can #include it here as we already
@@ -278,7 +287,7 @@
// TODO(w...@google.com): uses autoconf to detect
whether ::std::wstring
// is available.
-#if GTEST_OS_CYGWIN || GTEST_OS_SOLARIS
+#if GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || GTEST_OS_HPUX
// Cygwin 1.5 and below doesn't support ::std::wstring.
// Cygwin 1.7 might add wstring support; this should be updated when
clear.
// Solaris' libc++ doesn't support it either.
@@ -369,7 +378,7 @@
// MSVC 2008 (9.0) provides TR1 tuple in a 323 MB Feature Pack
// download, which we cannot assume the user has. MSVC 2010 isn't
// released yet.
-#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
+#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) && !defined
(_STLPORT_VERSION)
#define GTEST_USE_OWN_TR1_TUPLE 0
#else
#define GTEST_USE_OWN_TR1_TUPLE 1
3) src/*
Only in c:\lib\protobuf_ps\src: Debug
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\compiler
\command_line_interface_unittest.cc c:\lib\protobuf_ps\src\google
\protobuf\compiler\command_line_interface_unittest.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\compiler
\command_line_interface_unittest.cc Wed Aug 12 07:25:18 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\compiler
\command_line_interface_unittest.cc Fri Aug 14 09:22:09 2009
@@ -332,8 +332,8 @@
void CommandLineInterfaceTest::ExpectErrorText(const string&
expected_text) {
EXPECT_NE(0, return_code_);
- EXPECT_EQ(StringReplace(expected_text, "$tmpdir", temp_directory_,
true),
- error_text_);
+ const string s = StringReplace(expected_text, "$tmpdir",
temp_directory_, true);
+ EXPECT_EQ(s, error_text_);
}
void CommandLineInterfaceTest::ExpectErrorSubstring(
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\compiler
\importer.cc c:\lib\protobuf_ps\src\google\protobuf\compiler
\importer.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\compiler
\importer.cc Wed Aug 12 07:25:18 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\compiler\importer.cc Thu
Aug 13 17:22:58 2009
@@ -59,6 +59,7 @@
#ifndef F_OK
#define F_OK 00 // not defined by MSVC for whatever reason
#endif
+#include <ctype.h>
#endif
// Returns true if the text looks like a Windows-style absolute path,
starting
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf
\descriptor_unittest.cc c:\lib\protobuf_ps\src\google\protobuf
\descriptor_unittest.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf
\descriptor_unittest.cc Wed Aug 12 07:25:20 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\descriptor_unittest.cc Fri
Aug 14 09:18:53 2009
@@ -2025,9 +2025,8 @@
options->GetExtension
(protobuf_unittest::double_opt));
EXPECT_EQ("Hello, \"World\"",
options->GetExtension(protobuf_unittest::string_opt));
-
- EXPECT_EQ(string("Hello\0World", 11),
- options->GetExtension(protobuf_unittest::bytes_opt));
+ const string s("Hello\0World", 11);
+ EXPECT_EQ(s, options->GetExtension(protobuf_unittest::bytes_opt));
EXPECT_EQ
(protobuf_unittest::DummyMessageContainingEnum::TEST_OPTION_ENUM_TYPE2,
options->GetExtension(protobuf_unittest::enum_opt));
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\io
\zero_copy_stream_unittest.cc c:\lib\protobuf_ps\src\google\protobuf\io
\zero_copy_stream_unittest.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\io
\zero_copy_stream_unittest.cc Wed Aug 12 07:25:19 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\io
\zero_copy_stream_unittest.cc Thu Aug 13 17:22:59 2009
@@ -50,6 +50,7 @@
#ifdef _MSC_VER
#include <io.h>
+#include <crtdbg.h>
#else
#include <unistd.h>
#endif
@@ -520,7 +521,7 @@
// these debug assertions while in scope.
class MsvcDebugDisabler {
public:
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
MsvcDebugDisabler() {
old_handler_ = _set_invalid_parameter_handler(MyHandler);
old_mode_ = _CrtSetReportMode(_CRT_ASSERT, 0);
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs\hash.h c:
\lib\protobuf_ps\src\google\protobuf\stubs\hash.h
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs
\hash.h Wed Aug 12 07:25:14 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\stubs\hash.h Thu Aug 13
17:22:54 2009
@@ -98,7 +98,7 @@
class hash_set : public std::set<Key, HashFcn> {
};
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && !defined(_STLPORT_VERSION)
template <typename Key>
struct hash : public HASH_NAMESPACE::hash_compare<Key> {
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs\strutil.cc
c:\lib\protobuf_ps\src\google\protobuf\stubs\strutil.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs
\strutil.cc Wed Aug 12 07:25:14 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\stubs\strutil.cc Thu Aug 13
17:22:54 2009
@@ -1027,7 +1027,7 @@
bool safe_strtof(const char* str, float* value) {
char* endptr;
errno = 0; // errno only gets set on errors
-#ifdef _WIN32 // has no strtof()
+#if defined(_WIN32) || defined (GTEST_OS_HPUX) // has no strtof()
*value = strtod(str, &endptr);
#else
*value = strtof(str, &endptr);
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs\strutil.h c:
\lib\protobuf_ps\src\google\protobuf\stubs\strutil.h
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\stubs
\strutil.h Wed Aug 12 07:25:14 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\stubs\strutil.h Thu Aug 13
17:22:54 2009
@@ -33,6 +33,7 @@
#ifndef GOOGLE_PROTOBUF_STUBS_STRUTIL_H__
#define GOOGLE_PROTOBUF_STUBS_STRUTIL_H__
+#include <stdlib.h>
#include <vector>
#include <google/protobuf/stubs/common.h>
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\testing
\googletest.cc c:\lib\protobuf_ps\src\google\protobuf\testing
\googletest.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf\testing
\googletest.cc Wed Aug 12 07:25:13 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\testing\googletest.cc Fri
Aug 14 09:22:49 2009
@@ -46,6 +46,8 @@
#endif
#include <stdio.h>
#include <fcntl.h>
+#include <iostream>
+#include <fstream>
namespace google {
namespace protobuf {
@@ -94,7 +96,8 @@
// tmpnam() is generally not considered safe but we're only using
it for
// testing. We cannot use tmpfile() or mkstemp() since we're
creating a
// directory.
- string result = tmpnam(NULL);
+ char b[L_tmpnam + 1]; // HPUX multithread return 0 if s is 0
+ string result = tmpnam(b);
#ifdef _WIN32
// On Win32, tmpnam() returns a file prefixed with '\', but which
is supposed
// to be used in the current working directory. WTF?
@@ -141,7 +144,6 @@
}
// TODO(kenton): Share duplicated code below. Too busy/lazy for
now.
-
static string stdout_capture_filename_;
static string stderr_capture_filename_;
static int original_stdout_ = -1;
diff -x.svn -x *.pb.* -x *.mpc -x *.vcproj -x *.sln -r -u c:
\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf
\text_format_unittest.cc c:\lib\protobuf_ps\src\google\protobuf
\text_format_unittest.cc
--- c:\_ps2008\protobuf\protobuf-2.2.0\src\google\protobuf
\text_format_unittest.cc Wed Aug 12 07:25:20 2009
+++ c:\lib\protobuf_ps\src\google\protobuf\text_format_unittest.cc Fri
Aug 14 09:17:48 2009
@@ -589,8 +589,8 @@
// Note: Since these string literals have \0's in them, we must
explicitly
// pass their sizes to string's constructor.
ASSERT_EQ(1, message.repeated_string_size());
- EXPECT_EQ(string("\000\001\a\b\f\n\r\t\v\\\'\"", 12),
- message.repeated_string(0));
+ const string s("\000\001\a\b\f\n\r\t\v\\\'\"", 12);
+ EXPECT_EQ(s, message.repeated_string(0));
}
class TextFormatParserTest : public testing::Test {
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---