mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
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
This commit is contained in:
@ -167,10 +167,14 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
|
|||||||
#define EXPLICIT_SYMBOL(SYM) \
|
#define EXPLICIT_SYMBOL(SYM) \
|
||||||
if (!strcmp(symbolName, #SYM)) return &SYM
|
if (!strcmp(symbolName, #SYM)) return &SYM
|
||||||
// Try a few well known symbols just to give lli a shot at working.
|
// 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(stdin);
|
||||||
EXPLICIT_SYMBOL(stdout);
|
EXPLICIT_SYMBOL(stdout);
|
||||||
EXPLICIT_SYMBOL(stderr);
|
EXPLICIT_SYMBOL(stderr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#undef EXPLICIT_SYMBOL
|
#undef EXPLICIT_SYMBOL
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user