Switch usage of _DEBUG macro to NDEBUG.
http://stackoverflow.com/a/29253284/5237416 BUG=None R=tommi@webrtc.org NOPRESUBMIT=true Review URL: https://codereview.webrtc.org/1429513004 Cr-Commit-Position: refs/heads/master@{#10468}
This commit is contained in:
parent
5c3da4b6e9
commit
a41ab9326c
@ -23,11 +23,11 @@
|
||||
#include "webrtc/base/stringencode.h"
|
||||
#include "webrtc/base/stringutils.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
#define TRANSPARENT_CACHE_NAMES 1
|
||||
#else // !_DEBUG
|
||||
#else
|
||||
#define TRANSPARENT_CACHE_NAMES 0
|
||||
#endif // !_DEBUG
|
||||
#endif
|
||||
|
||||
namespace rtc {
|
||||
|
||||
@ -211,14 +211,14 @@ bool DiskCache::DeleteResource(const std::string& id) {
|
||||
}
|
||||
|
||||
bool DiskCache::CheckLimit() {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// Temporary check to make sure everything is working correctly.
|
||||
size_t cache_size = 0;
|
||||
for (EntryMap::iterator it = map_.begin(); it != map_.end(); ++it) {
|
||||
cache_size += it->second.size;
|
||||
}
|
||||
ASSERT(cache_size == total_size_);
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
|
||||
// TODO: Replace this with a non-brain-dead algorithm for clearing out the
|
||||
// oldest resources... something that isn't O(n^2)
|
||||
|
||||
@ -92,13 +92,13 @@ std::string ErrorName(int err, const ConstantLabel* err_table) {
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// By default, release builds don't log, debug builds at info level
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
LoggingSeverity LogMessage::min_sev_ = LS_INFO;
|
||||
LoggingSeverity LogMessage::dbg_sev_ = LS_INFO;
|
||||
#else // !_DEBUG
|
||||
#else
|
||||
LoggingSeverity LogMessage::min_sev_ = LS_NONE;
|
||||
LoggingSeverity LogMessage::dbg_sev_ = LS_NONE;
|
||||
#endif // !_DEBUG
|
||||
#endif
|
||||
bool LogMessage::log_to_stderr_ = true;
|
||||
|
||||
namespace {
|
||||
@ -340,7 +340,7 @@ void LogMessage::OutputToDebug(const std::string& str,
|
||||
LoggingSeverity severity,
|
||||
const std::string& tag) {
|
||||
bool log_to_stderr = log_to_stderr_;
|
||||
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && (!defined(_DEBUG) || defined(NDEBUG))
|
||||
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && defined(NDEBUG)
|
||||
// On the Mac, all stderr output goes to the Console log and causes clutter.
|
||||
// So in opt builds, don't log to stderr unless the user specifically sets
|
||||
// a preference to do so.
|
||||
|
||||
@ -285,7 +285,7 @@ class LogMessageVoidify {
|
||||
rtc::LogMessage(__FILE__, __LINE__, sev).stream()
|
||||
|
||||
// The _F version prefixes the message with the current function name.
|
||||
#if (defined(__GNUC__) && defined(_DEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": "
|
||||
#define LOG_T_F(sev) LOG(sev) << this << ": " << __PRETTY_FUNCTION__ << ": "
|
||||
#else
|
||||
|
||||
@ -511,14 +511,14 @@ bool BasicNetworkManager::CreateNetworks(bool include_ignored,
|
||||
PIP_ADAPTER_PREFIX prefixlist = adapter_addrs->FirstPrefix;
|
||||
std::string name;
|
||||
std::string description;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
name = ToUtf8(adapter_addrs->FriendlyName,
|
||||
wcslen(adapter_addrs->FriendlyName));
|
||||
#endif
|
||||
description = ToUtf8(adapter_addrs->Description,
|
||||
wcslen(adapter_addrs->Description));
|
||||
for (; address; address = address->Next) {
|
||||
#ifndef _DEBUG
|
||||
#if defined(NDEBUG)
|
||||
name = rtc::ToString(count);
|
||||
#endif
|
||||
|
||||
|
||||
@ -835,7 +835,7 @@ bool OpenSSLAdapter::SSLPostConnectionCheck(SSL* ssl, const char* host) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
|
||||
// We only use this for tracing and so it is only needed in debug mode
|
||||
|
||||
@ -864,11 +864,11 @@ OpenSSLAdapter::SSLInfoCallback(const SSL* s, int where, int ret) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
|
||||
int
|
||||
OpenSSLAdapter::SSLVerifyCallback(int ok, X509_STORE_CTX* store) {
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
if (!ok) {
|
||||
char data[256];
|
||||
X509* cert = X509_STORE_CTX_get_current_cert(store);
|
||||
@ -949,7 +949,7 @@ OpenSSLAdapter::SetupSSLContext() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
SSL_CTX_set_info_callback(ctx, SSLInfoCallback);
|
||||
#endif
|
||||
|
||||
|
||||
@ -67,9 +67,9 @@ private:
|
||||
static bool VerifyServerName(SSL* ssl, const char* host,
|
||||
bool ignore_bad_cert);
|
||||
bool SSLPostConnectionCheck(SSL* ssl, const char* host);
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
static void SSLInfoCallback(const SSL* s, int where, int ret);
|
||||
#endif // !_DEBUG
|
||||
#endif
|
||||
static int SSLVerifyCallback(int ok, X509_STORE_CTX* store);
|
||||
static VerificationCallback custom_verify_callback_;
|
||||
friend class OpenSSLStreamAdapter; // for custom_verify_callback_;
|
||||
|
||||
@ -186,7 +186,7 @@ void OpenSSLKeyPair::AddReference() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// Print a certificate to the log, for debugging.
|
||||
static void PrintCert(X509* x509) {
|
||||
BIO* temp_memory_bio = BIO_new(BIO_s_mem());
|
||||
@ -215,7 +215,7 @@ OpenSSLCertificate* OpenSSLCertificate::Generate(
|
||||
LogSSLErrors("Generating certificate");
|
||||
return NULL;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
PrintCert(x509);
|
||||
#endif
|
||||
OpenSSLCertificate* ret = new OpenSSLCertificate(x509);
|
||||
|
||||
@ -994,7 +994,7 @@ SSL_CTX* OpenSSLStreamAdapter::SetupSSLContext() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
SSL_CTX_set_info_callback(ctx, OpenSSLAdapter::SSLInfoCallback);
|
||||
#endif
|
||||
|
||||
|
||||
@ -171,12 +171,12 @@ class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> {
|
||||
sockaddr* addr = reinterpret_cast<sockaddr*>(&addr_storage);
|
||||
int err = ::bind(s_, addr, static_cast<int>(len));
|
||||
UpdateLastError();
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
if (0 == err) {
|
||||
dbg_addr_ = "Bound @ ";
|
||||
dbg_addr_.append(GetLocalAddress().ToString());
|
||||
}
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -361,10 +361,10 @@ class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> {
|
||||
if (err == 0) {
|
||||
state_ = CS_CONNECTING;
|
||||
enabled_events_ |= DE_ACCEPT;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
dbg_addr_ = "Listening @ ";
|
||||
dbg_addr_.append(GetLocalAddress().ToString());
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@ -549,9 +549,9 @@ class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> {
|
||||
ConnState state_;
|
||||
AsyncResolver* resolver_;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
std::string dbg_addr_;
|
||||
#endif // _DEBUG;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(WEBRTC_POSIX)
|
||||
@ -1088,10 +1088,10 @@ class SocketDispatcher : public Dispatcher, public PhysicalSocket {
|
||||
if (ff != DE_CONNECT)
|
||||
LOG(LS_VERBOSE) << "Signalled with DE_CONNECT: " << ff;
|
||||
enabled_events_ &= ~DE_CONNECT;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
dbg_addr_ = "Connected @ ";
|
||||
dbg_addr_.append(GetRemoteAddress().ToString());
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
SignalConnectEvent(this);
|
||||
}
|
||||
if (((ff & DE_ACCEPT) != 0) && (id_ == cache_id)) {
|
||||
|
||||
@ -532,7 +532,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -686,7 +686,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -825,7 +825,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -963,7 +963,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -1101,7 +1101,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -1241,7 +1241,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -1381,7 +1381,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -1521,7 +1521,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
@ -1662,7 +1662,7 @@ namespace sigslot {
|
||||
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool connected(has_slots_interface* pclass)
|
||||
{
|
||||
lock_block<mt_policy> lock(this);
|
||||
|
||||
@ -77,11 +77,11 @@ size_t asccpyn(wchar_t* buffer, size_t buflen,
|
||||
} else if (srclen >= buflen) {
|
||||
srclen = buflen - 1;
|
||||
}
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// Double check that characters are not UTF-8
|
||||
for (size_t pos = 0; pos < srclen; ++pos)
|
||||
RTC_DCHECK_LT(static_cast<unsigned char>(source[pos]), 128);
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
std::copy(source, source + srclen, buffer);
|
||||
buffer[srclen] = 0;
|
||||
return srclen;
|
||||
|
||||
@ -68,7 +68,7 @@ void Task::Start() {
|
||||
|
||||
void Task::Step() {
|
||||
if (done_) {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// we do not know how !blocked_ happens when done_ - should be impossible.
|
||||
// But it causes problems, so in retail build, we force blocked_, and
|
||||
// under debug we assert.
|
||||
@ -88,7 +88,7 @@ void Task::Step() {
|
||||
// SignalDone();
|
||||
|
||||
Stop();
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// verify that stop removed this from its parent
|
||||
ASSERT(!parent()->IsChildTask(this));
|
||||
#endif
|
||||
@ -125,7 +125,7 @@ void Task::Step() {
|
||||
// SignalDone();
|
||||
|
||||
Stop();
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// verify that stop removed this from its parent
|
||||
ASSERT(!parent()->IsChildTask(this));
|
||||
#endif
|
||||
@ -150,7 +150,7 @@ void Task::Abort(bool nowake) {
|
||||
// "done_" is set before calling "Stop()" to ensure that this code
|
||||
// doesn't execute more than once (recursively) for the same task.
|
||||
Stop();
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// verify that stop removed this from its parent
|
||||
ASSERT(!parent()->IsChildTask(this));
|
||||
#endif
|
||||
|
||||
@ -46,7 +46,7 @@ void TaskParent::AddChild(Task *child) {
|
||||
children_->insert(child);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool TaskParent::IsChildTask(Task *task) {
|
||||
ASSERT(task != NULL);
|
||||
return task->parent_ == this && children_->find(task) != children_->end();
|
||||
@ -69,7 +69,7 @@ bool TaskParent::AnyChildError() {
|
||||
|
||||
void TaskParent::AbortAllChildren() {
|
||||
if (children_->size() > 0) {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
runner_->IncrementAbortCount();
|
||||
#endif
|
||||
|
||||
@ -78,7 +78,7 @@ void TaskParent::AbortAllChildren() {
|
||||
(*it)->Abort(true); // Note we do not wake
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
runner_->DecrementAbortCount();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ class TaskParent {
|
||||
|
||||
bool AllChildrenDone();
|
||||
bool AnyChildError();
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool IsChildTask(Task *task);
|
||||
#endif
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ TaskRunner::TaskRunner()
|
||||
: TaskParent(this),
|
||||
next_timeout_task_(NULL),
|
||||
tasks_running_(false)
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
, abort_count_(0),
|
||||
deleting_task_(NULL)
|
||||
#endif
|
||||
@ -88,11 +88,11 @@ void TaskRunner::InternalRunTasks(bool in_destructor) {
|
||||
need_timeout_recalc = true;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
deleting_task_ = task;
|
||||
#endif
|
||||
delete task;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
deleting_task_ = NULL;
|
||||
#endif
|
||||
tasks_[i] = NULL;
|
||||
|
||||
@ -44,7 +44,7 @@ class TaskRunner : public TaskParent, public sigslot::has_slots<> {
|
||||
|
||||
void UpdateTaskTimeout(Task* task, int64_t previous_task_timeout_time);
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool is_ok_to_delete(Task* task) {
|
||||
return task == deleting_task_;
|
||||
}
|
||||
@ -87,7 +87,7 @@ class TaskRunner : public TaskParent, public sigslot::has_slots<> {
|
||||
std::vector<Task *> tasks_;
|
||||
Task *next_timeout_task_;
|
||||
bool tasks_running_;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
int abort_count_;
|
||||
Task* deleting_task_;
|
||||
#endif
|
||||
|
||||
@ -345,7 +345,7 @@ bool Thread::SetAllowBlockingCalls(bool allow) {
|
||||
|
||||
// static
|
||||
void Thread::AssertBlockingIsAllowedOnCurrentThread() {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
Thread* current = Thread::Current();
|
||||
ASSERT(!current || current->blocking_calls_allowed_);
|
||||
#endif
|
||||
|
||||
@ -78,12 +78,12 @@ int main(int argc, char** argv) {
|
||||
_CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, TestCrtReportHandler);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG // Turn on memory leak checking on Windows.
|
||||
#if !defined(NDEBUG) // Turn on memory leak checking on Windows.
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF |_CRTDBG_LEAK_CHECK_DF);
|
||||
if (FLAG_crt_break_alloc >= 0) {
|
||||
_crtBreakAlloc = FLAG_crt_break_alloc;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
#endif // WEBRTC_WIN
|
||||
|
||||
rtc::Filesystem::SetOrganizationName("google");
|
||||
|
||||
@ -55,7 +55,7 @@ static const int ICMP_HEADER_SIZE = 8u;
|
||||
static const int ICMP_PING_TIMEOUT_MILLIS = 10000u;
|
||||
|
||||
// TODO: Enable for production builds also? Use FormatMessage?
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
LPCSTR WSAErrorToString(int error, LPCSTR *description_result) {
|
||||
LPCSTR string = "Unspecified";
|
||||
LPCSTR description = "Unspecified description";
|
||||
@ -626,7 +626,7 @@ void Win32Socket::OnSocketNotify(SOCKET socket, int event, int error) {
|
||||
case FD_CONNECT:
|
||||
if (error != ERROR_SUCCESS) {
|
||||
ReportWSAError("WSAAsync:connect notify", error, addr_);
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
int32_t duration = TimeSince(connect_time_);
|
||||
LOG(LS_INFO) << "WSAAsync:connect error (" << duration
|
||||
<< " ms), faking close";
|
||||
@ -639,7 +639,7 @@ void Win32Socket::OnSocketNotify(SOCKET socket, int event, int error) {
|
||||
// though the connect event never did occur.
|
||||
SignalCloseEvent(this, error);
|
||||
} else {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
int32_t duration = TimeSince(connect_time_);
|
||||
LOG(LS_INFO) << "WSAAsync:connect (" << duration << " ms)";
|
||||
#endif
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
ARDMainViewController *viewController = [[ARDMainViewController alloc] init];
|
||||
_window.rootViewController = viewController;
|
||||
|
||||
#ifndef _DEBUG
|
||||
#if defined(NDEBUG)
|
||||
// In debug builds the default level is LS_INFO and in non-debug builds it is
|
||||
// disabled. Continue to log to console in non-debug builds, but only
|
||||
// warnings and errors.
|
||||
|
||||
@ -362,7 +362,7 @@ void XmppClient::Private::OnSocketRead() {
|
||||
if (bytes_read == 0)
|
||||
return;
|
||||
|
||||
//#ifdef _DEBUG
|
||||
//#if !defined(NDEBUG)
|
||||
client_->SignalLogInput(bytes, static_cast<int>(bytes_read));
|
||||
//#endif
|
||||
|
||||
@ -386,7 +386,7 @@ void XmppClient::Private::OnStateChange(int state) {
|
||||
}
|
||||
|
||||
void XmppClient::Private::WriteOutput(const char* bytes, size_t len) {
|
||||
//#ifdef _DEBUG
|
||||
//#if !defined(NDEBUG)
|
||||
client_->SignalLogOutput(bytes, static_cast<int>(len));
|
||||
//#endif
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ using rtc::ConstantLabel;
|
||||
|
||||
namespace buzz {
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
const ConstantLabel XmppLoginTask::LOGINTASK_STATES[] = {
|
||||
KLABEL(LOGINSTATE_INIT),
|
||||
KLABEL(LOGINSTATE_STREAMSTART_SENT),
|
||||
@ -40,7 +40,7 @@ const ConstantLabel XmppLoginTask::LOGINTASK_STATES[] = {
|
||||
KLABEL(LOGINSTATE_DONE),
|
||||
LASTLABEL
|
||||
};
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
XmppLoginTask::XmppLoginTask(XmppEngineImpl * pctx) :
|
||||
pctx_(pctx),
|
||||
authNeeded_(true),
|
||||
@ -84,10 +84,10 @@ XmppLoginTask::Advance() {
|
||||
|
||||
const XmlElement * element = NULL;
|
||||
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
LOG(LS_VERBOSE) << "XmppLoginTask::Advance - "
|
||||
<< rtc::ErrorName(state_, LOGINTASK_STATES);
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
|
||||
switch (state_) {
|
||||
|
||||
|
||||
@ -77,9 +77,9 @@ private:
|
||||
|
||||
rtc::scoped_ptr<SaslMechanism> sasl_mech_;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
static const rtc::ConstantLabel LOGINTASK_STATES[];
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ XmppClientInterface::~XmppClientInterface() {
|
||||
XmppTask::XmppTask(XmppTaskParentInterface* parent,
|
||||
XmppEngine::HandlerLevel level)
|
||||
: XmppTaskBase(parent), stopped_(false) {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
debug_force_timeout_ = false;
|
||||
#endif
|
||||
|
||||
@ -70,7 +70,7 @@ void XmppTask::OnDisconnect() {
|
||||
}
|
||||
|
||||
void XmppTask::QueueStanza(const XmlElement* stanza) {
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
if (debug_force_timeout_)
|
||||
return;
|
||||
#endif
|
||||
|
||||
@ -119,7 +119,7 @@ class XmppTask : public XmppTaskBase,
|
||||
std::string task_id() const { return id_; }
|
||||
void set_task_id(std::string id) { id_ = id; }
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
void set_debug_force_timeout(const bool f) { debug_force_timeout_ = f; }
|
||||
#endif
|
||||
|
||||
@ -162,7 +162,7 @@ private:
|
||||
rtc::scoped_ptr<XmlElement> next_stanza_;
|
||||
std::string id_;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
bool debug_force_timeout_;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -112,12 +112,12 @@ int main(int argc, char* argv[]) {
|
||||
char version_number[20];
|
||||
int mode = -1, tmp, nbTest = 0; /*,sss;*/
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
FILE* fy;
|
||||
double kbps;
|
||||
size_t totalbits = 0;
|
||||
int totalsmpls = 0;
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
|
||||
/* only one structure used for ISAC encoder */
|
||||
ISAC_MainStruct* ISAC_main_inst;
|
||||
@ -126,12 +126,12 @@ int main(int argc, char* argv[]) {
|
||||
BottleNeckModel BN_data;
|
||||
f_bn = NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
fy = fopen("bit_rate.dat", "w");
|
||||
fclose(fy);
|
||||
fy = fopen("bytes_frames.dat", "w");
|
||||
fclose(fy);
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
|
||||
// histfile = fopen("histo.dat", "ab");
|
||||
// ratefile = fopen("rates.dat", "ab");
|
||||
@ -589,7 +589,7 @@ int main(int argc, char* argv[]) {
|
||||
fprintf(stderr, " \rframe = %d", framecnt);
|
||||
framecnt++;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
|
||||
totalsmpls += declen;
|
||||
totalbits += 8 * stream_len;
|
||||
@ -598,15 +598,15 @@ int main(int argc, char* argv[]) {
|
||||
fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps);
|
||||
fclose(fy);
|
||||
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
printf("\n\ntotal bits = %" PRIuS " bits", totalbits);
|
||||
printf("\nmeasured average bitrate = %0.3f kbits/s",
|
||||
(double)totalbits * (FS / 1000) / totalsmpls);
|
||||
printf("\n");
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
|
||||
/* Runtime statistics */
|
||||
runtime = (double)(clock() / (double)CLOCKS_PER_SEC - starttime);
|
||||
|
||||
@ -73,10 +73,10 @@ int main(int argc, char* argv[]) {
|
||||
FILE* plFile;
|
||||
int32_t sendBN;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
FILE* fy;
|
||||
double kbps;
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
size_t totalbits = 0;
|
||||
int totalsmpls = 0;
|
||||
|
||||
@ -103,12 +103,12 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
BottleNeckModel BN_data;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
fy = fopen("bit_rate.dat", "w");
|
||||
fclose(fy);
|
||||
fy = fopen("bytes_frames.dat", "w");
|
||||
fclose(fy);
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
|
||||
/* Handling wrong input arguments in the command line */
|
||||
if ((argc < 3) || (argc > 17)) {
|
||||
@ -885,14 +885,14 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
totalsmpls += declen;
|
||||
totalbits += 8 * stream_len;
|
||||
#ifdef _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
kbps = ((double)sampFreqKHz * 1000.) / ((double)cur_framesmpls) * 8.0 *
|
||||
stream_len / 1000.0; // kbits/s
|
||||
fy = fopen("bit_rate.dat", "a");
|
||||
fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps);
|
||||
fclose(fy);
|
||||
|
||||
#endif /* _DEBUG */
|
||||
#endif
|
||||
}
|
||||
printf("\n");
|
||||
printf("total bits = %" PRIuS " bits\n", totalbits);
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include <sys/time.h> // gettimeofday
|
||||
#include <time.h>
|
||||
#endif
|
||||
#if (defined(_DEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#if (!defined(NDEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "webrtc/system_wrappers/include/tick_util.h"
|
||||
|
||||
#if (defined(_DEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#if (!defined(NDEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#define DEBUG_PRINT(...) \
|
||||
{ \
|
||||
char msg[256]; \
|
||||
@ -41,7 +41,7 @@
|
||||
#else
|
||||
// special fix for visual 2003
|
||||
#define DEBUG_PRINT(exp) ((void)0)
|
||||
#endif // defined(_DEBUG) && defined(_WIN32)
|
||||
#endif // !defined(NDEBUG) && defined(_WIN32)
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ class LogMessageVoidify {
|
||||
webrtc::LogMessage(__FILE__, __LINE__, sev).stream()
|
||||
|
||||
// The _F version prefixes the message with the current function name.
|
||||
#if (defined(__GNUC__) && defined(_DEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": "
|
||||
#else
|
||||
#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
|
||||
|
||||
@ -135,7 +135,7 @@ enum { kVoiceEngineMaxRtpExtensionId = 14 };
|
||||
stat.SetLastError(VE_FUNC_NOT_SUPPORTED); \
|
||||
return -1;
|
||||
|
||||
#if (defined(_DEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#if (!defined(NDEBUG) && defined(_WIN32) && (_MSC_VER >= 1400))
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#define DEBUG_PRINT(...) \
|
||||
@ -147,7 +147,7 @@ enum { kVoiceEngineMaxRtpExtensionId = 14 };
|
||||
#else
|
||||
// special fix for visual 2003
|
||||
#define DEBUG_PRINT(exp) ((void)0)
|
||||
#endif // defined(_DEBUG) && defined(_WIN32)
|
||||
#endif // !defined(NDEBUG) && defined(_WIN32)
|
||||
|
||||
#define CHECK_CHANNEL(channel) \
|
||||
if (CheckChannel(channel) == -1) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user