summaryrefslogtreecommitdiff
path: root/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/protobuf/src/google/protobuf/stubs/common.h')
-rw-r--r--chromium/third_party/protobuf/src/google/protobuf/stubs/common.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h
index e9d0e352556..4c3e0cb313f 100644
--- a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h
+++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h
@@ -48,17 +48,12 @@
#include <stdint.h>
#endif
-#ifndef PROTOBUF_USE_EXCEPTIONS
#if defined(_MSC_VER) && defined(_CPPUNWIND)
- #define PROTOBUF_USE_EXCEPTIONS 1
+ #define PROTOBUF_USE_EXCEPTIONS
#elif defined(__EXCEPTIONS)
- #define PROTOBUF_USE_EXCEPTIONS 1
-#else
- #define PROTOBUF_USE_EXCEPTIONS 0
-#endif
+ #define PROTOBUF_USE_EXCEPTIONS
#endif
-
-#if PROTOBUF_USE_EXCEPTIONS
+#ifdef PROTOBUF_USE_EXCEPTIONS
#include <exception>
#endif
@@ -128,24 +123,24 @@ namespace internal {
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 2005000
+#define GOOGLE_PROTOBUF_VERSION 2004002
// The minimum library version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 2005000
+#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 2004000
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// generator.
-static const int kMinHeaderVersionForLibrary = 2005000;
+static const int kMinHeaderVersionForLibrary = 2004000;
// The minimum protoc version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 2005000
+#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 2004000
// The minimum header version which works with the current version of
// protoc. This constant should only be used in VerifyVersion().
-static const int kMinHeaderVersionForProtoc = 2005000;
+static const int kMinHeaderVersionForProtoc = 2004000;
// Verifies that the headers and libraries are compatible. Use the macro
// below to call this.
@@ -361,6 +356,12 @@ inline To down_cast(From* f) { // so we only accept pointers
return static_cast<To>(f);
}
+// Simplified down_cast for reference type.
+template<typename To, typename From>
+inline To down_cast(From& f) {
+ return static_cast<To>(f);
+}
+
} // namespace internal
// We made these internal so that they would show up as such in the docs,
@@ -1208,7 +1209,7 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
} // namespace internal
-#if PROTOBUF_USE_EXCEPTIONS
+#ifdef PROTOBUF_USE_EXCEPTIONS
class FatalException : public std::exception {
public:
FatalException(const char* filename, int line, const std::string& message)