about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorILyoan <ilyoan@gmail.com>2012-11-29 19:36:03 +0900
committerBrian Anderson <banderson@mozilla.com>2013-01-13 16:43:39 -0800
commit4fb4be8f174c9d19c8ec6702070ef55987f73cb3 (patch)
tree1cab16b580d3776e4b5da77c62501427e1b3b23b /src
parent987f824f233faee4aed39dac92a1b442d42965cc (diff)
downloadrust-4fb4be8f174c9d19c8ec6702070ef55987f73cb3.tar.gz
rust-4fb4be8f174c9d19c8ec6702070ef55987f73cb3.zip
More android support
Conflicts:
	Makefile.in
	cmakeFiles/rustllvm.cmake
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_android_dummy.h12
-rw-r--r--src/rt/rust_builtin.cpp2
-rw-r--r--src/rt/rust_task.cpp6
3 files changed, 17 insertions, 3 deletions
diff --git a/src/rt/rust_android_dummy.h b/src/rt/rust_android_dummy.h
index 2e8b6f2c766..95a1774894b 100644
--- a/src/rt/rust_android_dummy.h
+++ b/src/rt/rust_android_dummy.h
@@ -2,4 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "execinfo.h"
+#ifndef _RUST_ANDROID_DUMMY_H
+#define _RUST_ANDROID_DUMMY_H
+
+int backtrace (void **__array, int __size);
+
+char **backtrace_symbols (void *__const *__array, int __size);
+
+void backtrace_symbols_fd (void *__const *__array, int __size, int __fd);
+
+#endif
+
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 0919ccf7f0e..de69272aca1 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -73,7 +73,7 @@ last_os_error() {
         task->fail();
         return NULL;
     }
-#elif defined(_GNU_SOURCE)
+#elif defined(_GNU_SOURCE) && !defined(__ANDROID__)
     char cbuf[BUF_BYTES];
     char *buf = strerror_r(errno, cbuf, sizeof(cbuf));
     if (!buf) {
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 9dd7c62f867..059085865d9 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -9,9 +9,13 @@
 // except according to those terms.
 
 
-#ifndef __WIN32__
+#ifndef __WIN32_
+#ifdef __ANDROID__
+#include "rust_android_dummy.h"
+#else
 #include <execinfo.h>
 #endif
+#endif
 #include <iostream>
 #include <algorithm>