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

Unified Diff: src/platform-freebsd.cc

Issue 11421013: v8: fix dragonflybsd build (Closed)
Patch Set: Created 8 years, 1 month 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 | « src/d8.gyp ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-freebsd.cc
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index 3ec02b780c047ca157163384cb056c37c39d5c70..c2cf6cbaec814fae4686e4d04e0e0aaec57afb17 100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -43,12 +43,15 @@
#include <sys/fcntl.h> // open
#include <unistd.h> // getpagesize
// If you don't have execinfo.h then you need devel/libexecinfo from ports.
-#include <execinfo.h> // backtrace, backtrace_symbols
#include <strings.h> // index
#include <errno.h>
#include <stdarg.h>
#include <limits.h>
+#if !defined(__DragonFly__)
Sven Panne 2013/01/02 08:06:46 One general comment about such #ifs: Instead of sc
+#include <execinfo.h> // backtrace, backtrace_symbols
+#endif
+
#undef MAP_TYPE
#include "v8.h"
@@ -296,6 +299,9 @@ void OS::SignalCodeMovingGC() {
int OS::StackWalk(Vector<OS::StackFrame> frames) {
+#if defined(__DragonFly__)
+ return 0;
+#else
int frames_size = frames.length();
ScopedVector<void*> addresses(frames_size);
@@ -320,6 +326,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
free(symbols);
return frames_count;
+#endif
}
@@ -618,6 +625,13 @@ void FreeBSDSemaphore::Wait() {
bool FreeBSDSemaphore::Wait(int timeout) {
+#if defined(__DragonFly__)
+ /* DragonFlyBSD lacks sem_timedwait() and there is no good way to emulate it.
+ */
+ if (sem_wait(&sem_)) abort();
+ USE(timeout);
+ return true;
+#else
const long kOneSecondMicros = 1000000; // NOLINT
// Split timeout into second and nanosecond parts.
@@ -643,6 +657,7 @@ bool FreeBSDSemaphore::Wait(int timeout) {
if (result == -1 && errno == ETIMEDOUT) return false; // Timeout.
CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup.
}
+#endif
}
« no previous file with comments | « src/d8.gyp ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698