summaryrefslogtreecommitdiffstats
path: root/third_party/libjingle/files
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 03:23:12 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 03:23:12 +0000
commitfb4c6a88fe584d0bc11507023b208a210b80a71f (patch)
tree9c55b51344359cc165a6894ec0db62b75011f5c2 /third_party/libjingle/files
parent4634dfa6cd9128f1aad2b455a43e802ad82510a5 (diff)
downloadchromium_src-fb4c6a88fe584d0bc11507023b208a210b80a71f.zip
chromium_src-fb4c6a88fe584d0bc11507023b208a210b80a71f.tar.gz
chromium_src-fb4c6a88fe584d0bc11507023b208a210b80a71f.tar.bz2
Use NDEBUG instead of _DEBUG for libjingle. This makes it so that debug code is used on non-Windows platforms, too.
BUG=31255 TEST=trybots Review URL: http://codereview.chromium.org/542004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libjingle/files')
-rw-r--r--third_party/libjingle/files/talk/base/criticalsection.h4
-rw-r--r--third_party/libjingle/files/talk/base/diskcache.cc10
-rw-r--r--third_party/libjingle/files/talk/base/openssladapter.cc10
-rw-r--r--third_party/libjingle/files/talk/base/openssladapter.h4
-rw-r--r--third_party/libjingle/files/talk/base/sigslot.h18
-rw-r--r--third_party/libjingle/files/talk/base/socketaddress.cc6
-rw-r--r--third_party/libjingle/files/talk/base/stringencode.cc4
-rw-r--r--third_party/libjingle/files/talk/base/stringutils.cc4
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmppclient.cc4
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmpplogintask.cc8
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmpplogintask.h4
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmpptask.cc6
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmpptask.h4
13 files changed, 43 insertions, 43 deletions
diff --git a/third_party/libjingle/files/talk/base/criticalsection.h b/third_party/libjingle/files/talk/base/criticalsection.h
index 937c5bb..9fa5aa5 100644
--- a/third_party/libjingle/files/talk/base/criticalsection.h
+++ b/third_party/libjingle/files/talk/base/criticalsection.h
@@ -36,9 +36,9 @@
#include <pthread.h>
#endif
-#ifdef _DEBUG
+#if !defined(NDEBUG)
#define CS_TRACK_OWNER 1
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
#if CS_TRACK_OWNER
#define TRACK_OWNER(x) x
diff --git a/third_party/libjingle/files/talk/base/diskcache.cc b/third_party/libjingle/files/talk/base/diskcache.cc
index 44e37d9..686e499 100644
--- a/third_party/libjingle/files/talk/base/diskcache.cc
+++ b/third_party/libjingle/files/talk/base/diskcache.cc
@@ -40,11 +40,11 @@
#include "talk/base/stringencode.h"
#include "talk/base/stringutils.h"
-#ifdef _DEBUG
+#if !defined(NDEBUG)
#define TRANSPARENT_CACHE_NAMES 1
-#else // !_DEBUG
+#else // defined(NDEBUG)
#define TRANSPARENT_CACHE_NAMES 0
-#endif // !_DEBUG
+#endif // !defined(NDEBUG)
namespace talk_base {
@@ -228,14 +228,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 // !defined(NDEBUG)
// TODO: Replace this with a non-brain-dead algorithm for clearing out the
// oldest resources... something that isn't O(n^2)
diff --git a/third_party/libjingle/files/talk/base/openssladapter.cc b/third_party/libjingle/files/talk/base/openssladapter.cc
index 1d4f02c..40ec6f1 100644
--- a/third_party/libjingle/files/talk/base/openssladapter.cc
+++ b/third_party/libjingle/files/talk/base/openssladapter.cc
@@ -616,7 +616,7 @@ OpenSSLAdapter::SSLPostConnectionCheck(SSL* ssl, const char* host) {
if (!certificate)
return false;
-#ifdef _DEBUG
+#if !defined(NDEBUG)
{
LOG(LS_INFO) << "Certificate from server:";
BIO* mem = BIO_new(BIO_s_mem());
@@ -704,7 +704,7 @@ 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
@@ -733,11 +733,11 @@ OpenSSLAdapter::SSLInfoCallback(const SSL* s, int where, int ret) {
}
}
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
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);
@@ -795,7 +795,7 @@ OpenSSLAdapter::SetupSSLContext() {
return NULL;
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
SSL_CTX_set_info_callback(ctx, SSLInfoCallback);
#endif
diff --git a/third_party/libjingle/files/talk/base/openssladapter.h b/third_party/libjingle/files/talk/base/openssladapter.h
index b794a7b..33ffdeb 100644
--- a/third_party/libjingle/files/talk/base/openssladapter.h
+++ b/third_party/libjingle/files/talk/base/openssladapter.h
@@ -69,9 +69,9 @@ private:
void Cleanup();
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 // !defined(NDEBUG)
static int SSLVerifyCallback(int ok, X509_STORE_CTX* store);
static SSL_CTX* SetupSSLContext();
diff --git a/third_party/libjingle/files/talk/base/sigslot.h b/third_party/libjingle/files/talk/base/sigslot.h
index 539db8a..c9f9645 100644
--- a/third_party/libjingle/files/talk/base/sigslot.h
+++ b/third_party/libjingle/files/talk/base/sigslot.h
@@ -527,7 +527,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -673,7 +673,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -804,7 +804,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -934,7 +934,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -1064,7 +1064,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -1196,7 +1196,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -1328,7 +1328,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -1460,7 +1460,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
@@ -1593,7 +1593,7 @@ namespace sigslot {
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
}
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool connected(has_slots<mt_policy>* pclass)
{
lock_block<mt_policy> lock(this);
diff --git a/third_party/libjingle/files/talk/base/socketaddress.cc b/third_party/libjingle/files/talk/base/socketaddress.cc
index e3a04d1..a6f0dd8 100644
--- a/third_party/libjingle/files/talk/base/socketaddress.cc
+++ b/third_party/libjingle/files/talk/base/socketaddress.cc
@@ -49,11 +49,11 @@ int inet_aton(const char * cp, struct in_addr * inp) {
}
#endif // WIN32
-#ifdef _DEBUG
+#if !defined(NDEBUG)
#define DISABLE_DNS 0
-#else // !_DEBUG
+#else // defined(NDEBUG)
#define DISABLE_DNS 0
-#endif // !_DEBUG
+#endif // !defined(NDEBUG)
namespace talk_base {
diff --git a/third_party/libjingle/files/talk/base/stringencode.cc b/third_party/libjingle/files/talk/base/stringencode.cc
index 3c3dae8..ffae6fe 100644
--- a/third_party/libjingle/files/talk/base/stringencode.cc
+++ b/third_party/libjingle/files/talk/base/stringencode.cc
@@ -523,7 +523,7 @@ void sprintf(std::string& value, size_t maxlen, const char * format, ...) {
// Unit Tests
/////////////////////////////////////////////////////////////////////////////
-#ifdef _DEBUG
+#if !defined(NDEBUG)
static int utf8_unittest() {
const struct Utf8Test {
@@ -573,7 +573,7 @@ static int utf8_unittest() {
int test = utf8_unittest();
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
/////////////////////////////////////////////////////////////////////////////
diff --git a/third_party/libjingle/files/talk/base/stringutils.cc b/third_party/libjingle/files/talk/base/stringutils.cc
index 1e43637..7ade7e5 100644
--- a/third_party/libjingle/files/talk/base/stringutils.cc
+++ b/third_party/libjingle/files/talk/base/stringutils.cc
@@ -69,11 +69,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)
ASSERT(static_cast<unsigned char>(source[pos]) < 128);
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
std::copy(source, source + srclen, buffer);
buffer[srclen] = 0;
return srclen;
diff --git a/third_party/libjingle/files/talk/xmpp/xmppclient.cc b/third_party/libjingle/files/talk/xmpp/xmppclient.cc
index 4f31890..c8e9a4b3 100644
--- a/third_party/libjingle/files/talk/xmpp/xmppclient.cc
+++ b/third_party/libjingle/files/talk/xmpp/xmppclient.cc
@@ -344,7 +344,7 @@ XmppClient::Private::OnSocketRead() {
if (bytes_read == 0)
return;
-//#ifdef _DEBUG
+//#if !defined(NDEBUG)
client_->SignalLogInput(bytes, bytes_read);
//#endif
@@ -372,7 +372,7 @@ XmppClient::Private::OnStateChange(int state) {
void
XmppClient::Private::WriteOutput(const char * bytes, size_t len) {
-//#ifdef _DEBUG
+//#if !defined(NDEBUG)
client_->SignalLogOutput(bytes, len);
//#endif
diff --git a/third_party/libjingle/files/talk/xmpp/xmpplogintask.cc b/third_party/libjingle/files/talk/xmpp/xmpplogintask.cc
index 2ce3d175..04c8dd1 100644
--- a/third_party/libjingle/files/talk/xmpp/xmpplogintask.cc
+++ b/third_party/libjingle/files/talk/xmpp/xmpplogintask.cc
@@ -41,7 +41,7 @@ using talk_base::ConstantLabel;
namespace buzz {
-#ifdef _DEBUG
+#if !defined(NDEBUG)
const ConstantLabel XmppLoginTask::LOGINTASK_STATES[] = {
KLABEL(LOGINSTATE_INIT),
KLABEL(LOGINSTATE_STREAMSTART_SENT),
@@ -56,7 +56,7 @@ const ConstantLabel XmppLoginTask::LOGINTASK_STATES[] = {
KLABEL(LOGINSTATE_DONE),
LASTLABEL
};
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
XmppLoginTask::XmppLoginTask(XmppEngineImpl * pctx) :
pctx_(pctx),
@@ -100,10 +100,10 @@ XmppLoginTask::Advance() {
const XmlElement * element = NULL;
-#if _DEBUG
+#if !defined(NDEBUG)
LOG(LS_VERBOSE) << "XmppLoginTask::Advance - "
<< talk_base::ErrorName(state_, LOGINTASK_STATES);
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
switch (state_) {
diff --git a/third_party/libjingle/files/talk/xmpp/xmpplogintask.h b/third_party/libjingle/files/talk/xmpp/xmpplogintask.h
index 993a6bf..f6c7d20 100644
--- a/third_party/libjingle/files/talk/xmpp/xmpplogintask.h
+++ b/third_party/libjingle/files/talk/xmpp/xmpplogintask.h
@@ -90,9 +90,9 @@ private:
scoped_ptr<SaslMechanism> sasl_mech_;
-#ifdef _DEBUG
+#if !defined(NDEBUG)
static const talk_base::ConstantLabel LOGINTASK_STATES[];
-#endif // _DEBUG
+#endif // !defined(NDEBUG)
};
}
diff --git a/third_party/libjingle/files/talk/xmpp/xmpptask.cc b/third_party/libjingle/files/talk/xmpp/xmpptask.cc
index 75334ae..fe8aebe 100644
--- a/third_party/libjingle/files/talk/xmpp/xmpptask.cc
+++ b/third_party/libjingle/files/talk/xmpp/xmpptask.cc
@@ -37,7 +37,7 @@ RateLimitManager task_rate_manager;
XmppTask::XmppTask(Task* parent, XmppEngine::HandlerLevel level)
: Task(parent), client_(NULL) {
-#ifdef _DEBUG
+#if !defined(NDEBUG)
debug_force_timeout_ = false;
#endif
@@ -85,7 +85,7 @@ void XmppTask::OnDisconnect() {
}
void XmppTask::QueueStanza(const XmlElement* stanza) {
-#ifdef _DEBUG
+#if !defined(NDEBUG)
if (debug_force_timeout_)
return;
#endif
@@ -171,4 +171,4 @@ bool XmppTask::VerifyTaskRateLimit(const std::string task_name, int max_count,
per_x_seconds);
}
-} \ No newline at end of file
+}
diff --git a/third_party/libjingle/files/talk/xmpp/xmpptask.h b/third_party/libjingle/files/talk/xmpp/xmpptask.h
index 156c9a5..fc8e076 100644
--- a/third_party/libjingle/files/talk/xmpp/xmpptask.h
+++ b/third_party/libjingle/files/talk/xmpp/xmpptask.h
@@ -77,7 +77,7 @@ class XmppTask :
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
@@ -120,7 +120,7 @@ private:
scoped_ptr<XmlElement> next_stanza_;
std::string id_;
-#ifdef _DEBUG
+#if !defined(NDEBUG)
bool debug_force_timeout_;
#endif
};