[llvm-commits] [compiler-rt] r145663 - /compiler-rt/trunk/lib/asan/asan_internal.h

Daniel Dunbar daniel at zuster.org
Thu Dec 1 17:32:27 PST 2011


Author: ddunbar
Date: Thu Dec  1 19:32:27 2011
New Revision: 145663

URL: http://llvm.org/viewvc/llvm-project?rev=145663&view=rev
Log:
lib/asan: Attempt to ensure __WORDSIZE gets defined, it is not always set by
Darwin's stdint.h for example.

Modified:
    compiler-rt/trunk/lib/asan/asan_internal.h

Modified: compiler-rt/trunk/lib/asan/asan_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_internal.h?rev=145663&r1=145662&r2=145663&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_internal.h (original)
+++ compiler-rt/trunk/lib/asan/asan_internal.h Thu Dec  1 19:32:27 2011
@@ -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





More information about the llvm-commits mailing list