aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-11 00:35:10 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-11 00:35:10 +0000
commit65de742b8a1f561268ed62d5b101016ea40756f8 (patch)
tree59df5ffd64de95052d509285cc3496d5963cd647 /lib
parent53054785115a4e7b521251fd698b6b82ee2c5c8f (diff)
downloadexternal_llvm-65de742b8a1f561268ed62d5b101016ea40756f8.zip
external_llvm-65de742b8a1f561268ed62d5b101016ea40756f8.tar.gz
external_llvm-65de742b8a1f561268ed62d5b101016ea40756f8.tar.bz2
Avoid taking the address of a macro by checking to see if stdin is defined
or not. This allows DynamicLibrary.cpp to compile on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/System/DynamicLibrary.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp
index f0ab51b..097e8b6 100644
--- a/lib/System/DynamicLibrary.cpp
+++ b/lib/System/DynamicLibrary.cpp
@@ -167,10 +167,14 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
#define EXPLICIT_SYMBOL(SYM) \
if (!strcmp(symbolName, #SYM)) return &SYM
// Try a few well known symbols just to give lli a shot at working.
+ // Note that on some systems stdin, etc. are macros so we have to
+ // avoid attempting to take the address of a macro :)
{
+#ifndef stdin
EXPLICIT_SYMBOL(stdin);
EXPLICIT_SYMBOL(stdout);
EXPLICIT_SYMBOL(stderr);
+#endif
}
#undef EXPLICIT_SYMBOL