summaryrefslogtreecommitdiff
path: root/libsanitizer/sanitizer_common
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-11-14 13:45:56 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2012-11-14 05:45:56 -0800
commit4a56a7be3d2cfca5cc74e75dc4b4365d8f1fbcc5 (patch)
tree521a5827a3669f95ceef08520353432f29971278 /libsanitizer/sanitizer_common
parent4053ca2c6f9c23468aaf1e85eb05d0314d6fe79b (diff)
downloadgcc-4a56a7be3d2cfca5cc74e75dc4b4365d8f1fbcc5.tar.gz
Check __x86_64__ instead of __WORDSIZE
PR other/55292 Backport from upstream revision 167883 * sanitizer_common/sanitizer_linux.cc (internal_mmap): Check __x86_64__ instead of __WORDSIZE. (internal_filesize): Likwise. From-SVN: r193500
Diffstat (limited to 'libsanitizer/sanitizer_common')
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_linux.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
index ab6c5a4b82c..e90a68ca1c4 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
@@ -34,7 +34,7 @@ namespace __sanitizer {
// --------------- sanitizer_libc.h
void *internal_mmap(void *addr, uptr length, int prot, int flags,
int fd, u64 offset) {
-#if __WORDSIZE == 64
+#if defined __x86_64__
return (void *)syscall(__NR_mmap, addr, length, prot, flags, fd, offset);
#else
return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset);
@@ -67,7 +67,7 @@ uptr internal_write(fd_t fd, const void *buf, uptr count) {
}
uptr internal_filesize(fd_t fd) {
-#if __WORDSIZE == 64
+#if defined __x86_64__
struct stat st;
if (syscall(__NR_fstat, fd, &st))
return -1;