From 6754335535ec1fca6665e343f0f1447e5972cd99 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Thu, 29 Jan 2015 18:33:36 -0500 Subject: [PATCH] Bug 1109248: basic adapation of new webrtc/base directory to build in mozilla rs=jesup --- media/webrtc/trunk/webrtc/base/base.gyp | 3 +++ media/webrtc/trunk/webrtc/base/base64.cc | 3 ++- media/webrtc/trunk/webrtc/base/macutils.cc | 11 +++++++++++ media/webrtc/trunk/webrtc/base/macutils.h | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/media/webrtc/trunk/webrtc/base/base.gyp b/media/webrtc/trunk/webrtc/base/base.gyp index 222e08c1a8d..22a83aa0e83 100644 --- a/media/webrtc/trunk/webrtc/base/base.gyp +++ b/media/webrtc/trunk/webrtc/base/base.gyp @@ -41,6 +41,9 @@ 'sources': [ 'checks.cc', 'checks.h', +# Moved by mozilla +# 'common.cc', +# 'common.h', 'exp_filter.cc', 'exp_filter.h', 'md5.cc', diff --git a/media/webrtc/trunk/webrtc/base/base64.cc b/media/webrtc/trunk/webrtc/base/base64.cc index 7ed373e8965..23d6422e42e 100644 --- a/media/webrtc/trunk/webrtc/base/base64.cc +++ b/media/webrtc/trunk/webrtc/base/base64.cc @@ -79,7 +79,8 @@ bool Base64::GetNextBase64Char(char ch, char* next_ch) { if (next_ch == NULL) { return false; } - const char* p = strchr(Base64Table, ch); + // Evil due to base/stringutils.h wanting non-standard &char for the second arg + const char* p = strchr(Base64Table, &ch); if (!p) return false; ++p; diff --git a/media/webrtc/trunk/webrtc/base/macutils.cc b/media/webrtc/trunk/webrtc/base/macutils.cc index 6e436d4a805..3d9a4cfd7df 100644 --- a/media/webrtc/trunk/webrtc/base/macutils.cc +++ b/media/webrtc/trunk/webrtc/base/macutils.cc @@ -10,7 +10,9 @@ #include +#ifndef WEBRTC_MOZILLA_BUILD #include "webrtc/base/common.h" +#endif #include "webrtc/base/logging.h" #include "webrtc/base/macutils.h" #include "webrtc/base/scoped_ptr.h" @@ -70,7 +72,9 @@ void DecodeFourChar(UInt32 fc, std::string* out) { } static bool GetGestalt(OSType ostype, int* value) { +#ifndef WEBRTC_MOZILLA_BUILD ASSERT(NULL != value); +#endif SInt32 native_value; OSStatus result = Gestalt(ostype, &native_value); if (noErr == result) { @@ -79,12 +83,16 @@ static bool GetGestalt(OSType ostype, int* value) { } std::string str; DecodeFourChar(ostype, &str); +#ifndef WEBRTC_MOZILLA_BUILD LOG_E(LS_ERROR, OS, result) << "Gestalt(" << str << ")"; +#endif return false; } bool GetOSVersion(int* major, int* minor, int* bugfix) { +#ifndef WEBRTC_MOZILLA_BUILD ASSERT(major && minor && bugfix); +#endif if (!GetGestalt(gestaltSystemVersion, major)) { return false; } @@ -141,6 +149,7 @@ bool GetQuickTimeVersion(std::string* out) { return true; } +#ifndef WEBRTC_MOZILLA_BUILD bool RunAppleScript(const std::string& script) { // TODO(thaloun): Add a .mm file that contains something like this: // NSString source from script @@ -214,6 +223,8 @@ bool RunAppleScript(const std::string& script) { return false; #endif // CARBON_DEPRECATED } +#endif // !WEBRTC_MOZILLA + #endif // WEBRTC_MAC && !defined(WEBRTC_IOS) /////////////////////////////////////////////////////////////////////////////// diff --git a/media/webrtc/trunk/webrtc/base/macutils.h b/media/webrtc/trunk/webrtc/base/macutils.h index 35c3d1870b3..2ea9fb766fb 100644 --- a/media/webrtc/trunk/webrtc/base/macutils.h +++ b/media/webrtc/trunk/webrtc/base/macutils.h @@ -47,10 +47,12 @@ bool GetOSVersion(int* major, int* minor, int* bugfix); MacOSVersionName GetOSVersionName(); bool GetQuickTimeVersion(std::string* version); +#ifndef WEBRTC_MOZILLA_BUILD // Runs the given apple script. Only supports scripts that does not // require user interaction. bool RunAppleScript(const std::string& script); #endif +#endif ///////////////////////////////////////////////////////////////////////////////