mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 16:36:40 +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/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…
Reference in New Issue
Block a user