mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
CBackend: Fix MSVC build.
This may produce warnings on MSVS, but it's better than failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bcf4b830b9
commit
08047f6169
@ -50,6 +50,10 @@
|
||||
#include "llvm/System/Host.h"
|
||||
#include "llvm/Config/config.h"
|
||||
#include <algorithm>
|
||||
// Some ms header decided to define setjmp as _setjmp, undo this for this file.
|
||||
#ifdef _MSC_VER
|
||||
#undef setjmp
|
||||
#endif
|
||||
using namespace llvm;
|
||||
|
||||
extern "C" void LLVMInitializeCBackendTarget() {
|
||||
|
@ -69,15 +69,15 @@ void IntrinsicEmitter::run(raw_ostream &OS) {
|
||||
void IntrinsicEmitter::EmitPrefix(raw_ostream &OS) {
|
||||
OS << "// VisualStudio defines setjmp as _setjmp\n"
|
||||
"#if defined(_MSC_VER) && defined(setjmp)\n"
|
||||
"#define setjmp_undefined_for_visual_studio\n"
|
||||
"#undef setjmp\n"
|
||||
"# pragma push_macro(\"setjmp\")\n"
|
||||
"# undef setjmp\n"
|
||||
"#endif\n\n";
|
||||
}
|
||||
|
||||
void IntrinsicEmitter::EmitSuffix(raw_ostream &OS) {
|
||||
OS << "#if defined(_MSC_VER) && defined(setjmp_undefined_for_visual_studio)\n"
|
||||
OS << "#if defined(_MSC_VER)\n"
|
||||
"// let's return it to _setjmp state\n"
|
||||
"#define setjmp _setjmp\n"
|
||||
"# pragma pop_macro(\"setjmp\")\n"
|
||||
"#endif\n\n";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user