by working around slightly "wrong" definition of uintptr_t on Mac OS X.
Verified that this works on both ia32 and x64 on Linux and Mac OS X.
Review URL: http://codereview.chromium.org/115252
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1938
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
Abort("Shared Object soname not applicable for Windows.")
if env['soname'] == 'on' and env['library'] == 'static':
Abort("Shared Object soname not applicable for static library.")
- if env['arch'] == 'x64' and env['os'] != 'linux':
- Abort("X64 compilation only allowed on Linux OS.")
for (name, option) in SIMPLE_OPTIONS.iteritems():
if (not option.get('default')) and (name not in ARGUMENTS):
message = ("A value for option %s must be specified (%s)." %
#define V8_UINT64_C(x) (x ## UI64)
#define V8_INT64_C(x) (x ## I64)
#define V8_PTR_PREFIX "ll"
-#else
+#else // _MSC_VER
#define V8_UINT64_C(x) (x ## UL)
#define V8_INT64_C(x) (x ## L)
#define V8_PTR_PREFIX "l"
-#endif
+#endif // _MSC_VER
#else // V8_HOST_ARCH_64_BIT
#define V8_PTR_PREFIX ""
-#endif
+#endif // V8_HOST_ARCH_64_BIT
#define V8PRIxPTR V8_PTR_PREFIX "x"
#define V8PRIdPTR V8_PTR_PREFIX "d"
+// Fix for Mac OS X defining uintptr_t as "unsigned long":
+#if defined(__APPLE__) && defined(__MACH__)
+#undef V8PRIxPTR
+#undef V8PRIdPTR
+#define V8PRIxPTR "lx"
+#define V8PRIdPTR "ld"
+#endif
+
// Code-point values in Unicode 4.0 are 21 bits wide.
typedef uint16_t uc16;
typedef int32_t uc32;
// Extracting the sample from the context is extremely machine dependent.
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
+#if V8_HOST_ARCH_X64
+ UNIMPLEMENTED();
+ USE(mcontext);
+ sample.pc = 0;
+ sample.sp = 0;
+ sample.fp = 0;
+#elif V8_HOST_ARCH_IA32
#if __DARWIN_UNIX03
sample.pc = mcontext->__ss.__eip;
sample.sp = mcontext->__ss.__esp;
sample.sp = mcontext->ss.esp;
sample.fp = mcontext->ss.ebp;
#endif // __DARWIN_UNIX03
+#else
+#error Unsupported Mac OS X host architecture.
+#endif // V8_TARGET_ARCH_IA32
}
// We always sample the VM state.