Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1232)

Unified Diff: src/base/platform/platform-posix.cc

Issue 508933002: Some PNaCL compatibility fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix includes for Mac. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/mark-compact-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index ee5b72ef94ecf7ac917e83ea9231f13cb58358c5..ea06ff51635344f4ee32d2915e0371c47589cadf 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -6,7 +6,6 @@
// own, but contains the parts which are the same across the POSIX platforms
// Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX.
-#include <dlfcn.h>
#include <errno.h>
#include <limits.h>
#include <pthread.h>
@@ -20,10 +19,12 @@
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
+#if !defined(__pnacl__)
#include <sys/syscall.h>
+#endif
#include <sys/time.h>
#include <sys/types.h>
-#if defined(__linux__)
+#if defined(__linux__) && !defined(__pnacl__)
#include <sys/prctl.h> // NOLINT, for prctl
#endif
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
@@ -31,10 +32,6 @@
#include <sys/sysctl.h> // NOLINT, for sysctl
#endif
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-
#undef MAP_TYPE
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
@@ -55,6 +52,10 @@
#include "src/base/atomicops.h"
#endif
+#if V8_OS_MACOSX
+#include <dlfcn.h>
+#endif
+
namespace v8 {
namespace base {
@@ -252,9 +253,13 @@ int OS::GetCurrentProcessId() {
int OS::GetCurrentThreadId() {
#if defined(ANDROID)
return static_cast<int>(syscall(__NR_gettid));
-#else
+#elif defined(SYS_gettid)
return static_cast<int>(syscall(SYS_gettid));
-#endif // defined(ANDROID)
+#else
+ // PNaCL doesn't have a way to get an integral thread ID, but it doesn't
+ // really matter, because we only need it in PerfJitLogger::LogRecordedBuffer.
+ return 0;
+#endif
}
« no previous file with comments | « no previous file | src/heap/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698