diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 18:29:36 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 18:29:36 +0000 |
commit | 13677b86fc97aeab327e476c7de42bc777a54ee4 (patch) | |
tree | 5e2682e91c0d09d63a6a54e36d9996fef5528e8d /base | |
parent | d929a9dfff856658662a962fd4dabed66d1e0b2f (diff) | |
download | chromium_src-13677b86fc97aeab327e476c7de42bc777a54ee4.zip chromium_src-13677b86fc97aeab327e476c7de42bc777a54ee4.tar.gz chromium_src-13677b86fc97aeab327e476c7de42bc777a54ee4.tar.bz2 |
net: Add NET_API to net/base
BUG=76997
TEST=NONE
Review URL: http://codereview.chromium.org/6969077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/compiler_specific.h | 16 | ||||
-rw-r--r-- | base/threading/non_thread_safe.h | 6 | ||||
-rw-r--r-- | base/win/object_watcher.h | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index 43ff21c..99e4f8e 100644 --- a/base/compiler_specific.h +++ b/base/compiler_specific.h @@ -54,6 +54,21 @@ code \ MSVC_POP_WARNING() +// Allows exporting a class that inherits from a non-exported base class. +// 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) { +// +// MSVC Compiler warning C4275: +// non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. +// Note that this is intended to be used only when no access to the base class +// can be gained through the derived class. For more info, see +// http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx +#define NON_EXPORTED_BASE(code) MSVC_SUPPRESS_WARNING(4275) \ + code + #else // Not MSVC #define MSVC_SUPPRESS_WARNING(n) @@ -63,6 +78,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 diff --git a/base/threading/non_thread_safe.h b/base/threading/non_thread_safe.h index e4a1c07..3f60fed 100644 --- a/base/threading/non_thread_safe.h +++ b/base/threading/non_thread_safe.h @@ -6,6 +6,12 @@ #define BASE_THREADING_NON_THREAD_SAFE_H_ #pragma once +// Classes deriving from NonThreadSafe may need to supress MSVC warning 4275: +// non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. +// There is a specific macro to do it: NON_EXPORTED_BASE(), defined in +// compiler_specific.h +#include "base/compiler_specific.h" + #ifndef NDEBUG #include "base/threading/non_thread_safe_impl.h" #endif diff --git a/base/win/object_watcher.h b/base/win/object_watcher.h index 0eef022..4cc6090 100644 --- a/base/win/object_watcher.h +++ b/base/win/object_watcher.h @@ -44,7 +44,7 @@ namespace win { // class BASE_API ObjectWatcher : public MessageLoop::DestructionObserver { public: - class Delegate { + class BASE_API Delegate { public: virtual ~Delegate() {} // Called from the MessageLoop when a signaled object is detected. To |