Enable WEBRTC_NO_TRACE for Chromium builds.

I'm also fixing WEBRTC_TRACE so that it won't break the build but on Linux I had to do something non traditional as is explained in the comments.
Review URL: http://webrtc-codereview.appspot.com/269012

git-svn-id: http://webrtc.googlecode.com/svn/trunk@939 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org 2011-11-14 09:39:31 +00:00
parent 0db7dc6e18
commit ded85f14ef
2 changed files with 25 additions and 5 deletions

View File

@ -95,6 +95,14 @@
'..','../..', # common_types.h, typedefs.h
],
'conditions': [
['build_with_chromium==1', {
'defines': [
# This turns off tracing in webrtc to reduce the noise from
# the Chrome memory bots. Down the line we will enable WebRTC
# tracing for Chromium and remove this.
'WEBRTC_NO_TRACE',
],
}],
['OS=="linux"', {
'defines': [
'WEBRTC_TARGET_PC',

View File

@ -19,12 +19,24 @@
#include "typedefs.h"
#ifdef WEBRTC_NO_TRACE
#define WEBRTC_TRACE
#ifdef WIN32
// Use __noop to avoid the C4353 compiler warning on Windows.
#define WEBRTC_TRACE __noop()
#else
// Ideally we would use __VA_ARGS__ but it's not supported by all compilers
// such as VS2003 (it's supported in VS2005). TODO (hellner) why
// would this be better than current implementation (not convinced)?
#define WEBRTC_TRACE Trace::Add
// This is a workaround. Ideally we should be able to do
// something like:
// #define WEBRTC_TRACE(...) ((void)0)
// However, we have code that creates variables with the only
// intent of tracing out their value. So, if we take the above
// approach, then we'll get a compiler error about unused variables. :(
inline void WebRtcNoTrace(...) {}
#define WEBRTC_TRACE WebRtcNoTrace
#endif
#else
// Ideally we would use _VA_ARGS_ but it's not supported by all compilers
// such as VS2003 (it's supported in VS2005). TODO (hellner) why
// would this be better than current implementation (not convinced)?
#define WEBRTC_TRACE Trace::Add
#endif
namespace webrtc {