Bug 1109248: basic adapation of new webrtc/base directory to build in mozilla rs=jesup

This commit is contained in:
Randell Jesup 2015-01-29 18:33:36 -05:00
parent 7edaac5678
commit 6754335535
4 changed files with 18 additions and 1 deletions

View File

@ -41,6 +41,9 @@
'sources': [
'checks.cc',
'checks.h',
# Moved by mozilla
# 'common.cc',
# 'common.h',
'exp_filter.cc',
'exp_filter.h',
'md5.cc',

View File

@ -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;

View File

@ -10,7 +10,9 @@
#include <sstream>
#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)
///////////////////////////////////////////////////////////////////////////////

View File

@ -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
///////////////////////////////////////////////////////////////////////////////