From e7194890617095d1857314ef06217a43554a1211 Mon Sep 17 00:00:00 2001 From: "liujisi@google.com" Date: Tue, 4 Dec 2012 22:06:04 +0000 Subject: Make PROTOBUF_USE_EXCEPTIONS configurable from CPPFLAGS. --- src/google/protobuf/stubs/common.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/google/protobuf/stubs/common.h') diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index e8916b05..f287ddfb 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -48,12 +48,17 @@ #include #endif +#ifndef PROTOBUF_USE_EXCEPTIONS #if defined(_MSC_VER) && defined(_CPPUNWIND) - #define PROTOBUF_USE_EXCEPTIONS + #define PROTOBUF_USE_EXCEPTIONS 1 #elif defined(__EXCEPTIONS) - #define PROTOBUF_USE_EXCEPTIONS + #define PROTOBUF_USE_EXCEPTIONS 1 +#else + #define PROTOBUF_USE_EXCEPTIONS 0 +#endif #endif -#ifdef PROTOBUF_USE_EXCEPTIONS + +#if PROTOBUF_USE_EXCEPTIONS #include #endif @@ -1188,7 +1193,7 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)()); } // namespace internal -#ifdef PROTOBUF_USE_EXCEPTIONS +#if PROTOBUF_USE_EXCEPTIONS class FatalException : public std::exception { public: FatalException(const char* filename, int line, const std::string& message) -- cgit v1.2.3