diff --git a/compiler-rt/lib/asan/asan_internal.h b/compiler-rt/lib/asan/asan_internal.h index 16d8e423033d..89b9e204fbb5 100644 --- a/compiler-rt/lib/asan/asan_internal.h +++ b/compiler-rt/lib/asan/asan_internal.h @@ -22,6 +22,16 @@ #include // for size_t #include // for _exit +// If __WORDSIZE was undefined by the platform, define it in terms of the +// compiler built-in __LP64__. +#ifndef __WORDSIZE +#if __LP64__ +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif +#endif + #ifdef ANDROID #include #endif