lib/asan: Attempt to ensure __WORDSIZE gets defined, it is not always set by

Darwin's stdint.h for example.

llvm-svn: 145663
This commit is contained in:
Daniel Dunbar 2011-12-02 01:32:27 +00:00
parent eb0a6c0a85
commit 9c665e36d4
1 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,16 @@
#include <stdlib.h> // for size_t
#include <unistd.h> // 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 <sys/atomics.h>
#endif