[llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp

Reid Spencer reid at x10sys.com
Wed Jan 10 16:35:25 PST 2007



Changes in directory llvm/lib/System:

DynamicLibrary.cpp updated: 1.19 -> 1.20
---
Log message:

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.


---
Diffs of the changes:  (+4 -0)

 DynamicLibrary.cpp |    4 ++++
 1 files changed, 4 insertions(+)


Index: llvm/lib/System/DynamicLibrary.cpp
diff -u llvm/lib/System/DynamicLibrary.cpp:1.19 llvm/lib/System/DynamicLibrary.cpp:1.20
--- llvm/lib/System/DynamicLibrary.cpp:1.19	Wed Jan 10 13:50:43 2007
+++ llvm/lib/System/DynamicLibrary.cpp	Wed Jan 10 18:35:10 2007
@@ -167,10 +167,14 @@
 #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
 






More information about the llvm-commits mailing list