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 <tfarina@chromium.org>.
Cr-Commit-Position: refs/heads/master@{#9032}
diff --git a/talk/build/common.gypi b/talk/build/common.gypi
index 093933c..bd42465 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 1c4415d..85e5b56 100644
--- a/talk/examples/peerconnection/client/peer_connection_client.cc
+++ b/talk/examples/peerconnection/client/peer_connection_client.cc
@@ -51,7 +51,7 @@
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 44305bc..0352741 100644
--- a/talk/examples/peerconnection/server/data_socket.cc
+++ b/talk/examples/peerconnection/server/data_socket.cc
@@ -31,7 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if defined(POSIX)
+#if defined(WEBRTC_POSIX)
#include <unistd.h>
#endif
diff --git a/talk/examples/stunserver/stunserver_main.cc b/talk/examples/stunserver/stunserver_main.cc
index 8b16a37..25cca16 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 <errno.h>
-#endif // POSIX
+#endif // WEBRTC_POSIX
#include <iostream>
diff --git a/webrtc/libjingle/examples/call/console.cc b/webrtc/libjingle/examples/call/console.cc
index a0da2af..0dfdd4b 100644
--- a/webrtc/libjingle/examples/call/console.cc
+++ b/webrtc/libjingle/examples/call/console.cc
@@ -29,11 +29,11 @@
#include <assert.h>
-#ifdef POSIX
+#if defined(WEBRTC_POSIX)
#include <signal.h>
#include <termios.h>
#include <unistd.h>
-#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::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;