From cb13f699837f68c8830ab67462f896c38aca37f0 Mon Sep 17 00:00:00 2001 From: kobalicek Date: Mon, 26 Oct 2020 09:18:37 +0100 Subject: [PATCH] Support for using even without NOMINMAX --- CMakeLists.txt | 2 + src/asmjit/asmjit-scope-begin.h | 35 +++++++++++++++++ src/asmjit/asmjit-scope-end.h | 27 +++++++++++++ src/asmjit/core.h | 69 +++++++++++++++++---------------- src/asmjit/x86.h | 20 +++++----- 5 files changed, 110 insertions(+), 43 deletions(-) create mode 100644 src/asmjit/asmjit-scope-begin.h create mode 100644 src/asmjit/asmjit-scope-end.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 57d9767..fd2efab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,6 +281,8 @@ endif() set(ASMJIT_SRC_LIST asmjit/asmjit.h + asmjit/asmjit-scope-begin.h + asmjit/asmjit-scope-end.h asmjit/core.h asmjit/core/api-build_p.h diff --git a/src/asmjit/asmjit-scope-begin.h b/src/asmjit/asmjit-scope-begin.h new file mode 100644 index 0000000..6ee5050 --- /dev/null +++ b/src/asmjit/asmjit-scope-begin.h @@ -0,0 +1,35 @@ +// AsmJit - Machine code generation for C++ +// +// * Official AsmJit Home Page: https://asmjit.com +// * Official Github Repository: https://github.com/asmjit/asmjit +// +// Copyright (c) 2008-2020 The AsmJit Authors +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +#ifdef _WIN32 + #pragma push_macro("min") + #pragma push_macro("max") + + #ifdef min + #undef min + #endif + + #ifdef max + #undef max + #endif +#endif diff --git a/src/asmjit/asmjit-scope-end.h b/src/asmjit/asmjit-scope-end.h new file mode 100644 index 0000000..447105a --- /dev/null +++ b/src/asmjit/asmjit-scope-end.h @@ -0,0 +1,27 @@ +// AsmJit - Machine code generation for C++ +// +// * Official AsmJit Home Page: https://asmjit.com +// * Official Github Repository: https://github.com/asmjit/asmjit +// +// Copyright (c) 2008-2020 The AsmJit Authors +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +#ifdef _WIN32 + #pragma pop_macro("min") + #pragma pop_macro("max") +#endif diff --git a/src/asmjit/core.h b/src/asmjit/core.h index 216d015..3b50c65 100644 --- a/src/asmjit/core.h +++ b/src/asmjit/core.h @@ -2005,40 +2005,41 @@ namespace asmjit { // [Core Headers] // ============================================================================ -#include "./core/globals.h" - -#include "./core/archtraits.h" -#include "./core/assembler.h" -#include "./core/builder.h" -#include "./core/codeholder.h" -#include "./core/compiler.h" -#include "./core/constpool.h" -#include "./core/cpuinfo.h" -#include "./core/datatypes.h" -#include "./core/emitter.h" -#include "./core/environment.h" -#include "./core/errorhandler.h" -#include "./core/features.h" -#include "./core/formatter.h" -#include "./core/func.h" -#include "./core/inst.h" -#include "./core/jitallocator.h" -#include "./core/jitruntime.h" -#include "./core/logger.h" -#include "./core/operand.h" -#include "./core/osutils.h" -#include "./core/string.h" -#include "./core/support.h" -#include "./core/target.h" -#include "./core/type.h" -#include "./core/virtmem.h" -#include "./core/zone.h" -#include "./core/zonehash.h" -#include "./core/zonelist.h" -#include "./core/zonetree.h" -#include "./core/zonestack.h" -#include "./core/zonestring.h" -#include "./core/zonevector.h" +#include "asmjit-scope-begin.h" +#include "core/archtraits.h" +#include "core/assembler.h" +#include "core/builder.h" +#include "core/codeholder.h" +#include "core/compiler.h" +#include "core/constpool.h" +#include "core/cpuinfo.h" +#include "core/datatypes.h" +#include "core/emitter.h" +#include "core/environment.h" +#include "core/errorhandler.h" +#include "core/features.h" +#include "core/formatter.h" +#include "core/func.h" +#include "core/globals.h" +#include "core/inst.h" +#include "core/jitallocator.h" +#include "core/jitruntime.h" +#include "core/logger.h" +#include "core/operand.h" +#include "core/osutils.h" +#include "core/string.h" +#include "core/support.h" +#include "core/target.h" +#include "core/type.h" +#include "core/virtmem.h" +#include "core/zone.h" +#include "core/zonehash.h" +#include "core/zonelist.h" +#include "core/zonetree.h" +#include "core/zonestack.h" +#include "core/zonestring.h" +#include "core/zonevector.h" +#include "asmjit-scope-end.h" // ============================================================================ // [Deprecated] diff --git a/src/asmjit/x86.h b/src/asmjit/x86.h index 69d47b4..2c49518 100644 --- a/src/asmjit/x86.h +++ b/src/asmjit/x86.h @@ -103,15 +103,17 @@ //! - \ref x86::Predicate::VReduce - `REDUCE[PD|PS|SD|SS]` predicate (AVX512+). //! - \ref x86::TLog - namespace that provides `VPTERNLOG[D|Q]` predicate / operations. -#include "./core.h" +#include "core.h" -#include "./x86/x86assembler.h" -#include "./x86/x86builder.h" -#include "./x86/x86compiler.h" -#include "./x86/x86emitter.h" -#include "./x86/x86features.h" -#include "./x86/x86globals.h" -#include "./x86/x86instdb.h" -#include "./x86/x86operand.h" +#include "asmjit-scope-begin.h" +#include "x86/x86assembler.h" +#include "x86/x86builder.h" +#include "x86/x86compiler.h" +#include "x86/x86emitter.h" +#include "x86/x86features.h" +#include "x86/x86globals.h" +#include "x86/x86instdb.h" +#include "x86/x86operand.h" +#include "asmjit-scope-end.h" #endif // ASMJIT_X86_H_INCLUDED