libvpx's UNUSED macro conflicts with webrtc/base's. Added missing include of assert.h. Globally defined function "Unused" in talk/base and its copy (webrtc/base) is causing a conflict.

libvpx macro (UNUSED) can be found here:
http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/libvpx/source/libvpx/vpx/vpx_codec.h

BUG=N/A
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17489004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6185 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2014-05-16 16:54:44 +00:00
parent a3b5673879
commit 14abcc7322
6 changed files with 25 additions and 44 deletions

View File

@ -125,26 +125,6 @@ namespace rtc {
((t) - 1)) & ~((t) - 1)))) ((t) - 1)) & ~((t) - 1))))
#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) #define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
// Note: UNUSED is also defined in common.h
#ifndef UNUSED
#define UNUSED(x) Unused(static_cast<const void*>(&x))
#define UNUSED2(x, y) Unused(static_cast<const void*>(&x)); \
Unused(static_cast<const void*>(&y))
#define UNUSED3(x, y, z) Unused(static_cast<const void*>(&x)); \
Unused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&z))
#define UNUSED4(x, y, z, a) Unused(static_cast<const void*>(&x)); \
Unused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&z)); \
Unused(static_cast<const void*>(&a))
#define UNUSED5(x, y, z, a, b) Unused(static_cast<const void*>(&x)); \
Unused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&z)); \
Unused(static_cast<const void*>(&a)); \
Unused(static_cast<const void*>(&b))
inline void Unused(const void*) {}
#endif // UNUSED
// Use these to declare and define a static local variable (static T;) so that // Use these to declare and define a static local variable (static T;) so that
// it is leaked so that its destructors are not called at exit. // it is leaked so that its destructors are not called at exit.
#define LIBJINGLE_DEFINE_STATIC_LOCAL(type, name, arguments) \ #define LIBJINGLE_DEFINE_STATIC_LOCAL(type, name, arguments) \

View File

@ -23,25 +23,24 @@
// General Utilities // General Utilities
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Note: UNUSED is also defined in basictypes.h #ifndef RTC_UNUSED
#ifndef UNUSED #define RTC_UNUSED(x) RtcUnused(static_cast<const void*>(&x))
#define UNUSED(x) Unused(static_cast<const void*>(&x)) #define RTC_UNUSED2(x, y) RtcUnused(static_cast<const void*>(&x)); \
#define UNUSED2(x, y) Unused(static_cast<const void*>(&x)); \ RtcUnused(static_cast<const void*>(&y))
Unused(static_cast<const void*>(&y)) #define RTC_UNUSED3(x, y, z) RtcUnused(static_cast<const void*>(&x)); \
#define UNUSED3(x, y, z) Unused(static_cast<const void*>(&x)); \ RtcUnused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&y)); \ RtcUnused(static_cast<const void*>(&z))
Unused(static_cast<const void*>(&z)) #define RTC_UNUSED4(x, y, z, a) RtcUnused(static_cast<const void*>(&x)); \
#define UNUSED4(x, y, z, a) Unused(static_cast<const void*>(&x)); \ RtcUnused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&y)); \ RtcUnused(static_cast<const void*>(&z)); \
Unused(static_cast<const void*>(&z)); \ RtcUnused(static_cast<const void*>(&a))
Unused(static_cast<const void*>(&a)) #define RTC_UNUSED5(x, y, z, a, b) RtcUnused(static_cast<const void*>(&x)); \
#define UNUSED5(x, y, z, a, b) Unused(static_cast<const void*>(&x)); \ RtcUnused(static_cast<const void*>(&y)); \
Unused(static_cast<const void*>(&y)); \ RtcUnused(static_cast<const void*>(&z)); \
Unused(static_cast<const void*>(&z)); \ RtcUnused(static_cast<const void*>(&a)); \
Unused(static_cast<const void*>(&a)); \ RtcUnused(static_cast<const void*>(&b))
Unused(static_cast<const void*>(&b)) inline void RtcUnused(const void*) {}
inline void Unused(const void*) {} #endif // RTC_UNUSED
#endif // UNUSED
#if !defined(WEBRTC_WIN) #if !defined(WEBRTC_WIN)

View File

@ -222,7 +222,7 @@ HttpServer::Connection::onHttpComplete(HttpMode mode, HttpError err) {
void void
HttpServer::Connection::onHttpClosed(HttpError err) { HttpServer::Connection::onHttpClosed(HttpError err) {
UNUSED(err); RTC_UNUSED(err);
server_->Remove(connection_id_); server_->Remove(connection_id_);
} }

View File

@ -144,8 +144,8 @@ static int socket_puts(BIO* b, const char* str) {
} }
static long socket_ctrl(BIO* b, int cmd, long num, void* ptr) { static long socket_ctrl(BIO* b, int cmd, long num, void* ptr) {
UNUSED(num); RTC_UNUSED(num);
UNUSED(ptr); RTC_UNUSED(ptr);
switch (cmd) { switch (cmd) {
case BIO_CTRL_RESET: case BIO_CTRL_RESET:

View File

@ -144,8 +144,8 @@ static int stream_puts(BIO* b, const char* str) {
} }
static long stream_ctrl(BIO* b, int cmd, long num, void* ptr) { static long stream_ctrl(BIO* b, int cmd, long num, void* ptr) {
UNUSED(num); RTC_UNUSED(num);
UNUSED(ptr); RTC_UNUSED(ptr);
switch (cmd) { switch (cmd) {
case BIO_CTRL_RESET: case BIO_CTRL_RESET:

View File

@ -10,6 +10,8 @@
#include "webrtc/modules/audio_device/android/single_rw_fifo.h" #include "webrtc/modules/audio_device/android/single_rw_fifo.h"
#include <assert.h>
static int UpdatePos(int pos, int capacity) { static int UpdatePos(int pos, int capacity) {
return (pos + 1) % capacity; return (pos + 1) % capacity;
} }