aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/stubs/strutil.cc
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2008-11-14 17:29:32 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2008-11-14 17:29:32 +0000
commita2a32c20434807e9966e3f48375f9419134d1b55 (patch)
tree16f115d52249335124cba31e959253275af624c4 /src/google/protobuf/stubs/strutil.cc
parent8da400ed12284575895cf7d5e4425435d4e43c42 (diff)
downloadprotobuf-a2a32c20434807e9966e3f48375f9419134d1b55.tar.gz
protobuf-a2a32c20434807e9966e3f48375f9419134d1b55.tar.bz2
protobuf-a2a32c20434807e9966e3f48375f9419134d1b55.zip
Support HP C++ on Tru64.
Patch (mostly) by Vincent Choinière <Choiniere.Vincent@hydro.qc.ca>.
Diffstat (limited to 'src/google/protobuf/stubs/strutil.cc')
-rw-r--r--src/google/protobuf/stubs/strutil.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index d3407faf..bc417344 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -58,17 +58,22 @@ inline bool IsNaN(double value) {
return value != value;
}
+// These are defined as macros on some platforms. #undef them so that we can
+// redefine them.
+#undef isxdigit
+#undef isprint
+
// The definitions of these in ctype.h change based on locale. Since our
// string manipulation is all in relation to the protocol buffer and C++
// languages, we always want to use the C locale. So, we re-define these
// exactly as we want them.
-static bool isxdigit(char c) {
+inline bool isxdigit(char c) {
return ('0' <= c && c <= '9') ||
('a' <= c && c <= 'f') ||
('A' <= c && c <= 'F');
}
-static bool isprint(char c) {
+inline bool isprint(char c) {
return c >= 0x20 && c <= 0x7E;
}