diff options
author | Eric Christopher <echristo@apple.com> | 2010-08-30 18:34:48 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-08-30 18:34:48 +0000 |
commit | 753f3265dafdcfeec07b561ca278524c35477583 (patch) | |
tree | c8adfeeb491b48394175af2929c2ba38323604ae /include/llvm-c | |
parent | 2027362e8d99df1780ba604cff624b116a4e6ecf (diff) |
Fix LLVM target initialization to deal with sociopathic outside projects
that like to randomly define things like "X86", regenerate autoconf bits
and update cmake.
Fixes PR7852.
Patch by Xerxes RÄnby!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c')
-rw-r--r-- | include/llvm-c/Target.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h index 29bd6fec9a..2cd15c3fa3 100644 --- a/include/llvm-c/Target.h +++ b/include/llvm-c/Target.h @@ -64,15 +64,10 @@ static inline void LLVMInitializeAllTargets(void) { for JIT applications to ensure that the target gets linked in correctly. */ static inline LLVMBool LLVMInitializeNativeTarget(void) { /* If we have a native target, initialize it to ensure it is linked in. */ -#ifdef LLVM_NATIVE_ARCH -#define DoInit2(TARG) \ - LLVMInitialize ## TARG ## Info (); \ - LLVMInitialize ## TARG () -#define DoInit(T) DoInit2(T) - DoInit(LLVM_NATIVE_ARCH); +#ifdef LLVM_NATIVE_TARGET + LLVM_NATIVE_TARGETINFO(); + LLVM_NATIVE_TARGET(); return 0; -#undef DoInit -#undef DoInit2 #else return 1; #endif |