From 91543731c3a850dcc52ae63be8cc257e507fb72d Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Mon, 20 Apr 2015 13:14:36 +0200 Subject: [PATCH] Do not define POSIX. It breaks integration with upstream re2 library on Chromium. Without patching re2 library, with this define, it produces the following error: ../../third_party/re2/re2/re2.h:254:5: error: expected identifier POSIX, // POSIX syntax, leftmost-longest match As we define POSIX on the command line, the C preprocessor changes RE2::POSIX to nothing and thus break the compilation. :( See chromium-dev mailing list for this discussion in https://groups.google.com/a/chromium.org/d/topic/chromium-dev/UXCHnX7pV44/discussion BUG=None TEST=ninja -C out/Debug, everything compiles as before R=sergeyu@chromium.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/46049004 Patch from Thiago Farina . Cr-Commit-Position: refs/heads/master@{#9032} --- talk/build/common.gypi | 1 - .../peerconnection/client/peer_connection_client.cc | 2 +- talk/examples/peerconnection/server/data_socket.cc | 2 +- talk/examples/stunserver/stunserver_main.cc | 4 ++-- webrtc/libjingle/examples/call/console.cc | 8 ++++---- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/talk/build/common.gypi b/talk/build/common.gypi index 093933cdc0..bd42465149 100644 --- a/talk/build/common.gypi +++ b/talk/build/common.gypi @@ -133,7 +133,6 @@ }, 'defines': [ 'HASH_NAMESPACE=__gnu_cxx', - 'POSIX', 'WEBRTC_POSIX', 'DISABLE_DYNAMIC_CAST', # The POSIX standard says we have to define this. diff --git a/talk/examples/peerconnection/client/peer_connection_client.cc b/talk/examples/peerconnection/client/peer_connection_client.cc index 1c4415d7a7..85e5b56425 100644 --- a/talk/examples/peerconnection/client/peer_connection_client.cc +++ b/talk/examples/peerconnection/client/peer_connection_client.cc @@ -51,7 +51,7 @@ rtc::AsyncSocket* CreateClientSocket(int family) { rtc::Win32Socket* sock = new rtc::Win32Socket(); sock->CreateT(family, SOCK_STREAM); return sock; -#elif defined(POSIX) +#elif defined(WEBRTC_POSIX) rtc::Thread* thread = rtc::Thread::Current(); ASSERT(thread != NULL); return thread->socketserver()->CreateAsyncSocket(family, SOCK_STREAM); diff --git a/talk/examples/peerconnection/server/data_socket.cc b/talk/examples/peerconnection/server/data_socket.cc index 44305bcbf7..03527418f3 100644 --- a/talk/examples/peerconnection/server/data_socket.cc +++ b/talk/examples/peerconnection/server/data_socket.cc @@ -31,7 +31,7 @@ #include #include #include -#if defined(POSIX) +#if defined(WEBRTC_POSIX) #include #endif diff --git a/talk/examples/stunserver/stunserver_main.cc b/talk/examples/stunserver/stunserver_main.cc index 8b16a377c8..25cca16e28 100644 --- a/talk/examples/stunserver/stunserver_main.cc +++ b/talk/examples/stunserver/stunserver_main.cc @@ -25,9 +25,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef POSIX +#if defined(WEBRTC_POSIX) #include -#endif // POSIX +#endif // WEBRTC_POSIX #include diff --git a/webrtc/libjingle/examples/call/console.cc b/webrtc/libjingle/examples/call/console.cc index a0da2af9e4..0dfdd4b3ac 100644 --- a/webrtc/libjingle/examples/call/console.cc +++ b/webrtc/libjingle/examples/call/console.cc @@ -29,11 +29,11 @@ #include -#ifdef POSIX +#if defined(WEBRTC_POSIX) #include #include #include -#endif // POSIX +#endif // WEBRTC_POSIX #include "talk/examples/call/callclient.h" #include "talk/examples/call/console.h" @@ -41,7 +41,7 @@ #include "webrtc/base/messagequeue.h" #include "webrtc/base/stringutils.h" -#ifdef POSIX +#ifdef WEBRTC_POSIX static void DoNothing(int unused) {} #endif @@ -147,7 +147,7 @@ void Console::RunConsole() { void Console::OnMessage(rtc::Message *msg) { switch (msg->message_id) { case MSG_START: -#ifdef POSIX +#if defined(WEBRTC_POSIX) // Install a no-op signal so that we can abort RunConsole() by raising // SIGUSR1. struct sigaction act;