summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2011-05-31 09:48:51 -0700
committerJean-Baptiste Queru <jbq@google.com>2011-05-31 09:51:40 -0700
commit5d10d1b0b2dff8fed028360ff8fb6ab715cb53e8 (patch)
tree63ce91a6f333743c479363dfce60882611f17e10 /android
parente5ee1dd168514c20afe765054339f2bd884f18f5 (diff)
downloadexternal_chromium-5d10d1b0b2dff8fed028360ff8fb6ab715cb53e8.zip
external_chromium-5d10d1b0b2dff8fed028360ff8fb6ab715cb53e8.tar.gz
external_chromium-5d10d1b0b2dff8fed028360ff8fb6ab715cb53e8.tar.bz2
Fix build. Switch to a new way of spoofing prctl.
The code so far relied on using a different definition from the bionic one, so there was no conflict. However bionic changed to move to the same definition, which caused a conflict at the C++ level. This uses the preprocessor to eliminate the conflict, by first including the headers that would be afected by the preprocessor trick and then redefining the function in question with the preprocessor. None of the call sites rely on side effects of evaluating parameters to prctl, so it's OK to have the preprocessor swallow them. Change-Id: Id33ec44d4faf0e50f4dcea4b3c073f6318e3bba5
Diffstat (limited to 'android')
-rw-r--r--android/prefix.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/prefix.h b/android/prefix.h
index ee0122d..7381620 100644
--- a/android/prefix.h
+++ b/android/prefix.h
@@ -28,6 +28,8 @@
// C++ specific changes
#ifdef __cplusplus
+#include <unistd.h>
+#include <sys/prctl.h>
// chromium refers to stl functions without std::
#include <algorithm>
using std::find;
@@ -36,7 +38,7 @@ using std::search;
// Called by command_line.cc to shorten the process name. Not needed for
// network stack.
-inline int prctl(int option, ...) { return 0; }
+#define prctl() (0)
namespace std {
// our new does not trigger oom