diff options
author | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 09:47:34 +0000 |
---|---|---|
committer | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 09:47:34 +0000 |
commit | a46b265eb9bb438adaefdbf574fd638df0894e15 (patch) | |
tree | c013c52bde487bc653ab855239abc85d0f239e46 | |
parent | b61e0e205a0945ad3c500447390c98967212e77a (diff) | |
download | chromium_src-a46b265eb9bb438adaefdbf574fd638df0894e15.zip chromium_src-a46b265eb9bb438adaefdbf574fd638df0894e15.tar.gz chromium_src-a46b265eb9bb438adaefdbf574fd638df0894e15.tar.bz2 |
Fix the dynamic_annotations build issues on Windows
Review URL: http://codereview.chromium.org/1997007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46670 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base.gypi | 4 | ||||
-rw-r--r-- | base/dynamic_annotations.cc | 2 | ||||
-rw-r--r-- | base/dynamic_annotations.h | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/base/base.gypi b/base/base.gypi index b2074c2..b5c3f31 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -64,6 +64,8 @@ 'dir_reader_fallback.h', 'dir_reader_linux.h', 'dir_reader_posix.h', + 'dynamic_annotations.h', + 'dynamic_annotations.cc', 'env_var.cc', 'env_var.h', 'event_trace_consumer_win.h', @@ -516,8 +518,6 @@ 'base_drop_target.cc', 'base_drop_target.h', 'data_pack.cc', - 'dynamic_annotations.h', - 'dynamic_annotations.cc', 'event_recorder.cc', 'event_recorder.h', 'event_recorder_stubs.cc', diff --git a/base/dynamic_annotations.cc b/base/dynamic_annotations.cc index 2ee0975..b1f4e19 100644 --- a/base/dynamic_annotations.cc +++ b/base/dynamic_annotations.cc @@ -59,7 +59,7 @@ extern "C" void AnnotateNoOp(const char *file, int line, // When running under valgrind, a non-zero value will be returned. extern "C" int RunningOnValgrind() { -#if defined(NVALGRIND) +#if defined(NVALGRIND) || !defined(RUNNING_ON_VALGRIND) return 0; #else return RUNNING_ON_VALGRIND; diff --git a/base/dynamic_annotations.h b/base/dynamic_annotations.h index 23a2a27..a6ed91e 100644 --- a/base/dynamic_annotations.h +++ b/base/dynamic_annotations.h @@ -26,7 +26,12 @@ #ifndef BASE_DYNAMIC_ANNOTATIONS_H_ #define BASE_DYNAMIC_ANNOTATIONS_H_ +#ifdef __GNUC__ +// valgrind.h uses gcc extensions so it may not build with other compilers. +// Also, it defines NVALGRIND on Windows, which disables dynamic annotations +// for ThreadSanitizer. #include "base/third_party/valgrind/valgrind.h" +#endif #ifndef NVALGRIND // ------------------------------------------------------------- |