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

Unified Diff: base/compiler_specific.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « no previous file | base/threading/non_thread_safe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/compiler_specific.h
===================================================================
--- base/compiler_specific.h (revision 85332)
+++ base/compiler_specific.h (working copy)
@@ -54,6 +54,19 @@
code \
MSVC_POP_WARNING()
+// Allows exporting a class that inherits from a non exported base class.
wtc 2011/05/16 23:07:13 Nit: add '-' between 'non' and 'exported'.
+// This uses suppress instead of push/pop because the delimiter after the
+// declaration (either "," or "{") has to be placed before the pop macro.
+//
+// Example usage:
+// Class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) {
+//
+// Compiler warning C4275:
wtc 2011/05/16 23:07:13 Nit: add "MSVC"
+// non dll-interface class 'Bar' used as base for dll-interface class 'Foo'
+// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
+#define NON_EXPORTED_BASE(code) MSVC_SUPPRESS_WARNING(4275) \
+ code
+
#else // Not MSVC
#define MSVC_SUPPRESS_WARNING(n)
@@ -63,6 +76,7 @@
#define MSVC_DISABLE_OPTIMIZE()
#define MSVC_ENABLE_OPTIMIZE()
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
+#define NON_EXPORTED_BASE(code) code
#endif // COMPILER_MSVC
« no previous file with comments | « no previous file | base/threading/non_thread_safe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698