mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 00:47:07 +00:00
CBackend: Fix MSVC build.
This may produce warnings on MSVS, but it's better than failures. llvm-svn: 113834
This commit is contained in:
parent
a845c8d2ff
commit
26fe225080
@ -50,6 +50,10 @@
|
|||||||
#include "llvm/System/Host.h"
|
#include "llvm/System/Host.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <algorithm>
|
#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;
|
using namespace llvm;
|
||||||
|
|
||||||
extern "C" void LLVMInitializeCBackendTarget() {
|
extern "C" void LLVMInitializeCBackendTarget() {
|
||||||
|
@ -69,15 +69,15 @@ void IntrinsicEmitter::run(raw_ostream &OS) {
|
|||||||
void IntrinsicEmitter::EmitPrefix(raw_ostream &OS) {
|
void IntrinsicEmitter::EmitPrefix(raw_ostream &OS) {
|
||||||
OS << "// VisualStudio defines setjmp as _setjmp\n"
|
OS << "// VisualStudio defines setjmp as _setjmp\n"
|
||||||
"#if defined(_MSC_VER) && defined(setjmp)\n"
|
"#if defined(_MSC_VER) && defined(setjmp)\n"
|
||||||
"#define setjmp_undefined_for_visual_studio\n"
|
"# pragma push_macro(\"setjmp\")\n"
|
||||||
"#undef setjmp\n"
|
"# undef setjmp\n"
|
||||||
"#endif\n\n";
|
"#endif\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntrinsicEmitter::EmitSuffix(raw_ostream &OS) {
|
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"
|
"// let's return it to _setjmp state\n"
|
||||||
"#define setjmp _setjmp\n"
|
"# pragma pop_macro(\"setjmp\")\n"
|
||||||
"#endif\n\n";
|
"#endif\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user