aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-08-17 20:34:29 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-08-17 20:34:29 +0000
commit3aa7a0dafe24faba4af8f70a257f74f07162e277 (patch)
tree282b3ee1e5c9ba4e5dfee215b708fda2404dad7d
parentad5672bad71821354380959eaf80ea487b9007f2 (diff)
HPUX patch from Alexander Melnikov.
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--src/google/protobuf/compiler/importer.cc1
-rw-r--r--src/google/protobuf/io/zero_copy_stream_unittest.cc2
-rw-r--r--src/google/protobuf/stubs/hash.h2
-rw-r--r--src/google/protobuf/stubs/strutil.cc2
-rw-r--r--src/google/protobuf/stubs/strutil.h1
-rw-r--r--src/google/protobuf/testing/googletest.cc5
7 files changed, 11 insertions, 4 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index f9f2a6a2..d2c3d18e 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -72,3 +72,5 @@ Patch contributors:
* Emacs mode for Protocol Buffers (editors/protobuf-mode.el).
Scott Stafford <scott.stafford@gmail.com>
* Added Swap(), SwapElements(), and RemoveLast() to Reflection interface.
+ Alexander Melnikov <alm@sibmail.ru>
+ * HPUX support.
diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc
index 8a07dfc4..7689ce93 100644
--- a/src/google/protobuf/compiler/importer.cc
+++ b/src/google/protobuf/compiler/importer.cc
@@ -59,6 +59,7 @@ namespace compiler {
#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 --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc
index c8f669a0..f919b7ac 100644
--- a/src/google/protobuf/io/zero_copy_stream_unittest.cc
+++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc
@@ -520,7 +520,7 @@ TEST_F(IoTest, GzipFileIo) {
// 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 --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h
index c3414138..a828a9c6 100644
--- a/src/google/protobuf/stubs/hash.h
+++ b/src/google/protobuf/stubs/hash.h
@@ -98,7 +98,7 @@ template <typename Key,
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 --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index a4764753..32b0f031 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -1027,7 +1027,7 @@ char* DoubleToBuffer(double value, char* buffer) {
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 (__hpux) // has no strtof()
*value = strtod(str, &endptr);
#else
*value = strtof(str, &endptr);
diff --git a/src/google/protobuf/stubs/strutil.h b/src/google/protobuf/stubs/strutil.h
index 7f6bd96f..c04c1230 100644
--- a/src/google/protobuf/stubs/strutil.h
+++ b/src/google/protobuf/stubs/strutil.h
@@ -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 --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc
index 1339b332..cd094d0c 100644
--- a/src/google/protobuf/testing/googletest.cc
+++ b/src/google/protobuf/testing/googletest.cc
@@ -46,6 +46,8 @@
#endif
#include <stdio.h>
#include <fcntl.h>
+#include <iostream>
+#include <fstream>
namespace google {
namespace protobuf {
@@ -94,7 +96,8 @@ string GetTemporaryDirectoryName() {
// 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?