Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/asmjit/asmjit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkobalicek <kobalicek.petr@gmail.com>2020-04-29 11:22:26 +0300
committerkobalicek <kobalicek.petr@gmail.com>2020-04-29 21:19:17 +0300
commit9057aa30b620f0662ff51e2230c126a345063064 (patch)
treea3e946071d9c5a04e881228b215c63d23fe59f30 /test
parent13367b59c2fab6fbd917ff039918dcd49044a802 (diff)
Improved AsmJit public API to not depend on <windows.h> header
Diffstat (limited to 'test')
-rw-r--r--test/asmjit_test_x86_cc.cpp8
-rw-r--r--test/asmjit_test_x86_sections.cpp6
2 files changed, 10 insertions, 4 deletions
diff --git a/test/asmjit_test_x86_cc.cpp b/test/asmjit_test_x86_cc.cpp
index 6fb144e..6617c7d 100644
--- a/test/asmjit_test_x86_cc.cpp
+++ b/test/asmjit_test_x86_cc.cpp
@@ -12,6 +12,11 @@
#include "./asmjit.h"
#include "./asmjit_test_misc.h"
+#ifdef _MSC_VER
+// Interaction between '_setjmp' and C++ object destruction is non-portable.
+#pragma warning(disable: 4611)
+#endif
+
using namespace asmjit;
// ============================================================================
@@ -174,10 +179,11 @@ int X86TestApp::run() {
x86::Compiler cc(&code);
test->compile(cc);
+ void* func = nullptr;
Error err = errorHandler._err;
+
if (!err)
err = cc.finalize();
- void* func;
#ifndef ASMJIT_NO_LOGGING
if (_dumpAsm) {
diff --git a/test/asmjit_test_x86_sections.cpp b/test/asmjit_test_x86_sections.cpp
index a60b763..e94742b 100644
--- a/test/asmjit_test_x86_sections.cpp
+++ b/test/asmjit_test_x86_sections.cpp
@@ -48,8 +48,8 @@ int main(int argc, char* argv[]) {
code.init(codeInfo);
code.setLogger(&logger);
- Section* section;
- Error err = code.newSection(&section, ".data", SIZE_MAX, 0, 8);
+ Section* dataSection;
+ Error err = code.newSection(&dataSection, ".data", SIZE_MAX, 0, 8);
if (err) {
fail("Failed to create a .data section", err);
@@ -82,7 +82,7 @@ int main(int argc, char* argv[]) {
a.emitEpilog(frame);
- a.section(section);
+ a.section(dataSection);
a.bind(data);
a.embed(dataArray, sizeof(dataArray));