aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/System/DynamicLibrary.cpp
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
commit750f80e30652210f4359d78f6e9c779498f4e174 (patch)
treec1a148d90e0a6c7fecef66051a0d5e0cf8ef9c2c /llvm/lib/System/DynamicLibrary.cpp
parent74bd0360596cb306da06bfd5d94b5dc4665ca301 (diff)
downloadllvm-750f80e30652210f4359d78f6e9c779498f4e174.zip
llvm-750f80e30652210f4359d78f6e9c779498f4e174.tar.gz
llvm-750f80e30652210f4359d78f6e9c779498f4e174.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. llvm-svn: 33064
Diffstat (limited to 'llvm/lib/System/DynamicLibrary.cpp')
-rw-r--r--llvm/lib/System/DynamicLibrary.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/System/DynamicLibrary.cpp b/llvm/lib/System/DynamicLibrary.cpp
index f0ab51b..097e8b6 100644
--- a/llvm/lib/System/DynamicLibrary.cpp
+++ b/llvm/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