Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: third_party/protobuf/src/google/protobuf/stubs/common.h

Issue 12090058: Componentize protobuf_lite (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/protobuf_lite.gypi ('k') | third_party/protobuf/src/google/protobuf/stubs/once.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/src/google/protobuf/stubs/common.h
diff --git a/third_party/protobuf/src/google/protobuf/stubs/common.h b/third_party/protobuf/src/google/protobuf/stubs/common.h
index 00af41a35ece90ad24aa429ef5e46a31c202595d..cad22fa6c3bfe59fd90ad3a9845d65a7bfc21309 100644
--- a/third_party/protobuf/src/google/protobuf/stubs/common.h
+++ b/third_party/protobuf/src/google/protobuf/stubs/common.h
@@ -85,18 +85,33 @@ namespace protobuf {
TypeName(const TypeName&); \
void operator=(const TypeName&)
-#if defined(_MSC_VER) && defined(PROTOBUF_USE_DLLS)
- #ifdef LIBPROTOBUF_EXPORTS
- #define LIBPROTOBUF_EXPORT __declspec(dllexport)
- #else
- #define LIBPROTOBUF_EXPORT __declspec(dllimport)
+// The macros defined below are required in order to make protobuf_lite a
+// component on all platforms. See http://crbug.com/172800.
+#if defined(COMPONENT_BUILD) && defined(PROTOBUF_USE_DLLS)
+ #if defined(_MSC_VER)
+ #ifdef LIBPROTOBUF_EXPORTS
+ #define LIBPROTOBUF_EXPORT __declspec(dllexport)
+ #else
+ #define LIBPROTOBUF_EXPORT __declspec(dllimport)
+ #endif
+ #ifdef LIBPROTOC_EXPORTS
+ #define LIBPROTOC_EXPORT __declspec(dllexport)
+ #else
+ #define LIBPROTOC_EXPORT __declspec(dllimport)
+ #endif
+ #else // defined(_MSC_VER)
+ #ifdef LIBPROTOBUF_EXPORTS
+ #define LIBPROTOBUF_EXPORT __attribute__((visibility("default")))
+ #else
+ #define LIBPROTOBUF_EXPORT
+ #endif
+ #ifdef LIBPROTOC_EXPORTS
+ #define LIBPROTOC_EXPORT __attribute__((visibility("default")))
+ #else
+ #define LIBPROTOC_EXPORT
+ #endif
#endif
- #ifdef LIBPROTOC_EXPORTS
- #define LIBPROTOC_EXPORT __declspec(dllexport)
- #else
- #define LIBPROTOC_EXPORT __declspec(dllimport)
- #endif
-#else
+#else // defined(COMPONENT_BUILD) && defined(PROTOBUF_USE_DLLS)
#define LIBPROTOBUF_EXPORT
#define LIBPROTOC_EXPORT
#endif
« no previous file with comments | « third_party/protobuf/protobuf_lite.gypi ('k') | third_party/protobuf/src/google/protobuf/stubs/once.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698